PlugPDF SDK iOS Developer Guide

How can I hide the top bar and bottom bar?

PlugPDF provides the method that can hide the PlugPDF Viewer’s top bar and bottom bar.

The way to hide the PlugPDF Viewer’s top bar and bottom bar would be suitable for just PDF Viewer.

The method is for someone who does not want to use annotation features and bottom page slider.

If you do not want to use pdf editing functions, you can use the below codes.

You can hide and show the topbar and bottombar.

//the below code is for setting TopBar
[viewController setEnableTopBar:NO];
//the below code is for setting bottomBar
[viewController setEnableBottomBar:NO];

Moreover, you can add your own top bar instead of use PlugPDF Viewer.

How can I hide the Page number indicator on PlugPDF Viewer?

PlugPDF provides page number indicator to show the current page number and the total number of pages.

There is a way you can make your own page number indicator with PlugPDFViewController properties.

To get the total number of pages, PlugPDFViewController’s pageCount property would provide the number.

Also, PlugPDFViewController pageIdx property is for the current page number.

Anyway, the PlugPDF page number indicator would be useful with many pages pdf that has many pages.

However, you may not want to use the page number indicator if you want to show a single pdf page.

The below code will hide the page number indicator.

[viewController setEnablePageIndicator:NO];

Next, we will show you how to change the page number indicator position.

How can I change Page number indicator position?

The page number indicator position can be changed with the setPageIndicatorPoint method.

You can decide the point to put the page indicator with below code.

[viewController setPageIndicatorPoint:CGPointMake(x, y)];

How can I detect that page was changed?

In the PlugPDFDocumentViewEventDelegate, there is a callback method to detect when page is changed.

- (void)pageDidChange:(PlugPDFDocumentView *)documentView pageIdx:(NSInteger)pageIdx
    //you can add some code that you want

Also, the below method is  Called when the page is about to be visible.

- (BOOL)pageWillChange: (PlugPDFDocumentView*)documentView pageIdx: (NSInteger)pageIdx
return  NO; // return no is default action, but you can change YES with your action.

How can I get page slider value?

You may want to show a pop-up alert or something when the page slider value.

So, there is a way that you can do with changing the slider value.

In the PlugPDFDocumentViewControllerDelegate file, there is a callback method about the page slider value.

Take a look the below code.

- (void) pageSliderValueChanged:(PlugPDFDocumentViewController*)viewController
// In this bracket, you can do whatever you want.

How to change page Preview size.

In our PDF viewer, we support page slider with the preview feature. The PDF preview will show you the page slider value pdf page.

Although PlugPDF provides page slider’s preview, the preview size may not big enough for you.

So, there are some methods that you can make the preview bigger or change the preview’s position.

The below code allows you to change the preview size.

[viewController setPagePreviewSize: CGSizeMake(100, 100)]; // width, height

Also, the below code can set the preview size and position.

[viewController setPagePreviewRect: CGRectMake(30, 30, 200, 200)]; //x,y. width, height

How can I go to the recent page when I close the PlugPDF Viewer?

Sometimes, it is quite annoying to find the recent page when we close pdf viewer.

It is possible to go the recent PDF page with PlugPDF SDK.

You just need to add 1 code line to see the recent page.

[viewController setEnableUseRecentPage: YES];

When you set No, PDF viewer will show the first page.

How can I set Document title on PlugPDF Viewer?

You may want to show your application name in the top bar instead of showing pdf title.

So, there is a way you can set the title in the top bar in your pdf viewer.

The below code shows you how to set the title in the pdf viewer.

First of all, you can decide your title UILabel cgrect size.

viewController.menuItemTitle = [[UILabel alloc] initWithFrame: CGRectMake(0, 0, 20, 15)];

Then, you can set text with your application name or whatever.

viewController.menuItemTitle.text = @"PlugPDF PDF Viewer"; // set the title

Moreover, you can  customize the menuitemtitle background color, text color, font size and userinteraction option.

[viewController.menuItemTitle setBackgroundColor: [UIColor blackColor]]; //background color
[viewController.menuItemTitle setTextColor: [UIColor whiteColor]]; //Text color
[viewController.menuItemTitle setFont: [UIFont systemFontOfSize: 14.0]]; // font size
[viewController.menuItemTitle setUserInteractionEnabled: NO]; //userinteraction.