Apryse SDK allows you to convert non-pdf documents such as office and image files to PDF documents.
For Android, available in the full version of the library only. See Apryse full or standard?
Internet connection is not required for conversion.
If you are already using any of DocumentActivity or PdfViewCtrlTabHostFragment2 , you will not need to go through this article as viewing other document types is already taken care of internally. Continue reading this article if you are not planning to use any of the above.
Saving annotations back to non-PDF formats is not supported. You can instead save the annotated PDFDoc to a PDF file.
PDFViewCtrl
has a powerful and seamless conversion system which allows you to stream documents during conversion to PDF. It supports the following file types:
In this tutorial you will be able to display a non-PDF file in PDFViewCtrl
.
Before going forward, please make sure you have finished setting up PDFViewCtrl
as described in Using PDFViewCtrl.
The easiest way to display a non-PDF file in PDFViewCtrl
is through the PDFViewCtrl.openNonPDFUri
API.
Please follow the latest Android best practices and guidelines outlined here
Add the following when you would like to show the document, typically onCreate
or onResume
of your Activity or Fragment:
Add the following when you would like to show the document, typically onCreate
or onResume
of your Activity or Fragment:
To monitor the conversion event, do:
Saving annotations back to non-PDF formats is not supported. You can instead save the annotated PDFDoc
to a PDF file.
Apryse has a powerful conversion system which allows you to convert many file formats to PDF. The PTConvert
class handles the conversion process and supports the following file types:
.docx
, .pptx
, .xlsx
, .doc
(with the office conversion Add-On module).bmp
, .jpg
, .tif
, .png
, .gif
.md
(with the office conversion Add-On module)The simplest way to convert and view any file format that Apryse supports is to use the PTDocumentController
(or PTTabbedDocumentViewController
) method openDocumentWithURL:
. This method supports local files, files opened from remote cloud services and "raw" http
URLs.
Another way is to convert a file with the Convert
class's StreamingPDFConversion(String, ConversionOptions)
method. The following code shows how to convert a non-PDF file using Apryse's internal conversion:
The result of the conversion will be contained in the provided PTPDFDoc
, which can then be displayed.
In addition to the file types supported by Apryse's internal conversion, it is also possible to convert many other file types with an iOS-specific API. The PTConvert
class's +convertOfficeToPDF:paperSize:completion:
method can convert any file type supported by WKWebView
to PDF. Some of the supported file types include:
.pages
, .key
, .numbers
.doc
, .ppt
, .xls
.rtf
The following code shows how to convert a file with the iOS-specific API:
Please see this guide about Web/HTML to PDF.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales