Need some solution for few tool and toolbar

Product: PDFNet

Hey team, we have two questions can you please provide a solution for them?

  1. ToolbarHiding :
    → Issue brief:
    On iPad, if we zoom in and zoom out the pdfviewctrl by double-tap, the Tools toolbar is getting hidden behind the toolgroup toolbar. We have observed that pdfViewCtrl.pagePresentationMode = e_trn_single_page is causing issue. We have added this property for our requirements. How can we fix this issue?
    → Video:

    → Sample Code:
    ToolbarHideIssue.zip (2.0 KB)

[To run: add this in the project and make viewcontroller initial viewcontroller]

  1. Note markup
    → Can we stop changing note markup size on zoom in, zoom out and also on Note selection? On zoom in and zoom out the position of the mark-up is a little different. (It is not zooming in on the center instead it is changing size on x1,y1 point) Can we stop changing its size or set it to zoom out on center?
    → Video:

Thanks

1 Like

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

1 Like

Hi @rankit.agarwal,

Thank you for the video and sample code, we are investigating now.

For the second issue with the note icon, we have added this to our backlog and will hopefully be able to get to it in our upcoming sprint.

Hi @rankit.agarwal,

For the second issue you could set it to zoom out to center by setting it’s anchor point to center. For this use this API: PTText Class Reference

This has to be done in for new annotation and already existing annotations.

For new annotations setAnchorPoint can be called in PTToolManagerDelegate

- (void)toolManager:(PTToolManager *)toolManager annotationAdded:(PTAnnot *)annotation onPageNumber:(unsigned long)pageNumber

Here’s the sample code for new annotations:

- (void)toolManager:(PTToolManager *)toolManager annotationAdded:(PTAnnot *)annotation onPageNumber:(unsigned long)pageNumber
{
    if([annotation extendedAnnotType] == PTExtendedAnnotTypeText) {
        [self.pdfViewCtrl DocLock:YES withBlock:^(PTPDFDoc * _Nullable doc) {
            PTText *text = [[PTText alloc] initWithAnn:annotation];
            PTPDFPoint *centerPoint = [[PTPDFPoint alloc] initWithPx:0.5 py:0.5];
            [text SetAnchorPosition:centerPoint];
        } error:nil];
    }
}

For already existing annotations you can look at this sample code: PDFTron Systems Inc. | Documentation

Where you set the anchor point on any existing Sticky Text annotation.

Let us know if you face any issues regarding this.

Regards,
Sahil Behl.