Some test text!

Getting started

keyboard_arrow_down
Running samplesTry demo in your projectDownloading PDFTronIntegrating PDFTron via GradleManually integrating PDFTronUpgradingAdding PDFTron license keyUsing ProGuardTroubleshooting integration

Fundamentals

keyboard_arrow_down
Document lockingSaving PDF documentsUnderstanding coordinates

Basics

keyboard_arrow_down
Using an ActivityUsing a FragmentUsing PDFViewCtrlViewer configConverting and viewing other document typesConverting HTML to PDF

Viewer

keyboard_arrow_down
PDFViewCtrl color modesPDFViewCtrl page view modePDFViewCtrl page presentation modeGenerating thumbnails in PDF

Features

keyboard_arrow_down
Day/Night themesUndo and redoText searchAnnotation syncingRotating PDF pagesPDFViewCtrl read onlyUsing PDFViewCtrl with minimum memory

Tools

keyboard_arrow_down
Tools overviewSetting Up ToolManagerChanging and disabling toolsIntercepting annotation handlingToolManager eventsDefault annotation propertiesTool subclasses

Annotations

keyboard_arrow_down
Deleting annotationsAnnotation styleShow/hide annotations

UI components

keyboard_arrow_down
Quick menuAnnotation toolbarAnnotation style dialogThumbnail sliderAnnotations listOutline listUser bookmarks listBookmarks dialogPage thumbnails dialogAdd page dialogRotate pages dialogView mode dialogCrop page dialogReflow

Advanced

keyboard_arrow_down
Adding a custom view to a PDF pageCustom toolCustomizing quick menuCustomizing annotation style dialog

FAQ

keyboard_arrow_down
Running project in Android StudioSystem RequirementsPDFTron full vs. standardLocalizationIcon cheat sheetRunning sample with sourceReducing size of APKEnable multidexOut of memory when rotating device multiple timesDetachCurrentThread warning

PDF Processing API

keyboard_arrow_down
What is PDFNet?Opening a documentSerializing (saving) a documentWorking with pagesWorking with Page ContentWorking with BookmarksWorking with Interactive Forms (AcroForms)PDF SecurityLow-level PDF APIError handling
Add page dialogkeyboard_arrow_down

Add page dialog

In this document
chevron_rightPage options
chevron_rightpage type (
chevron_rightpage size (
chevron_rightpage color (
chevron_rightCreating a new PDF document
chevron_rightAdding pages to an existing document

With AddPageDialogFragment users are able to add new pages to an existing document, or to create a new document with new pages. The new pages can have various types, sizes and colors.

Add page dialog from left to right: dialog for creating new document, dialog for adding pages to an existing document.

linkPage options

The following options are available for creating pages:

linkpage type (PageType)

Currently, the following types of page are supported in this dialog:

  • Blank: a page with nothing on it.
  • Lined: a page with horizontal lines on it.
  • Grid: a page with a superimposed grid on it.
  • Graph: a page with Cartesian axes on it.
  • Music: a page set up with modern staff notation for notating music.

linkpage size (PageSize)

Currently, the following page sizes are supported in this dialog: Custom, Letter, Legal, A4, A3, Ledger.

The Custom option is only available when adding new pages to an existing PDF document, not when a new document is being created. The page size of Custom option is specified as here: add pages to an existing document

linkpage color (PageColor)

The page background can be set to the following colors: White, Yellow, and Blueprint.

linkCreating a new PDF document

To create a new PDF document, call newInstance() and override the OnCreateNewDocumentListener interface. The implementation of onCreateNewDocument(PDFDoc, String) should create a new file with the given title normalized to a ".pdf" extension.



linkAdding pages to an existing document

To add pages to an existing PDF, create a new instance of the add page dialog fragment using newInstance(double, double) and provide the valid page width and page height arguments.These arguments will be used only if the user selects the Custom option in the Page Size dropdown. You also must implement the OnAddNewPagesListener interface and override onAddNewPages(Page[]), in which the implementation should add the provided pages to the document.