Posts

How to change the default font on iOS with Objective-C.

Sometimes your application with PlugPDF SDK  does not display your native language or some special characters because our default font may not support some languages and special characters. Also, you may do not like our default font style.

So, we will see a simple way how to change the default font on PlugPDF SDK for iOS.

 

Adding your font

First of all, you need to prepare a font file you wan to use.

Choose the Build phase > Copy Bundle Resources and then press on the + button as shown in the figure below.  

buildphase   

Select your font file.

font

The below is shown the font file is added.

copybundle

 

Set the font

Now,we are ready to change the default font.

This code snippet enables you can set the font.

The default font can be set within the AppDelegate.m file by calling the PlugPDFInit function from the didFinishLaunchingWithOptions method.

 

Changing the string’s language on iOS.

You may want to change string’s language with your mother language. This can be done by customizing the localizable.strings file in the PlugPDF bundle.

The localizable.strings file provide a simple way to change the strings in your app. Below simple steps show you how to change the strings.

  1. Select the PlugPDF.bundle
  2. Select the en.lproj folder
  3. Open the Localizable.strings
  4. Delete all of the content inside Localizable.strings
  5. Copy and Paste the key and value strings

 

Select the PlugPDF.bundle

plugpdfbundle

Select the en.lproj folder

enlproj

Open the Localizable.strings

localizablestrings

Delete all of the content inside Localizable.strings

When you open the Localizable.string file, you can see meaningless characters. What you need to do is just ignore and delete all of the strange words.

localizablestringscontent

Copy and Paste the key and value strings in the Localizable.strings

The below code provide you to change strings that you want. The first inside double quotes string is the key and the second double quotes is value. So, you can change the values.

After the following steps, you can change the value like the below.

Now not only the default value “Google” was changed to “Search”,but also you can see that the pop-up text was changed.

googlesearch

 

How to Sign a PDF Document with a PKI Certificate on iOS

The PlugPDF SDK allows you to sign and validate your PDF documents with one or more signatures. To do so, please follow these steps.

  1. Prepare an image object. This is the visual appearance of a signature field (optional)
  2. Create a signature field (this is a form field containing a digital signature)
  3. Compute a byte range digest
  4. Inject the computed byte range into the signature field created in Step 2.

Then, validating a PDF document is a two step process:

  1. Get a signature field
  2. Get a computed byte range digest data in the signature field

Read more

How to Customize the Navigation & Tool Bars on iOS

Some times you may want to hide or restrict certain features of the default reader capability whereas in other occasions you’ll need to change the look and feel of your PDF reader. This can be done by customizing the PlugPDFDocumentViewController.

The PlugPDF SDK’s PlugPDFDocumentViewController class offers a simple way to put PDF reading capabilities in your app. Below are shown three different ways to customize it.

  1. How to show/hide default menu items on the navigation bar
  2. How to add a custom menu item to the navigation bar
  3. How to make a custom navigation/tool bar

Read more