Some test text!
Xamarin / Guides / Convert to PDF
Apryse SDK allows you to convert non-pdf documents such as office and image files to PDF documents.
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.
Add the following when you would like to show the document, typically onCreate
or onResume
of your Activity or Fragment:
var nonPdfUri = Android.Net.Uri.FromFile(new Java.IO.File("my_file_path"));
var documentConversion = pdfViewCtrl.OpenNonPDFUri(nonPdfUri, null);
Add the following when you would like to show the document, typically onCreate
or onResume
of your Activity or Fragment:
var nonPdfContentUri = Android.Net.Uri.Parse("my_content_uri");
var documentConversion = pdfViewCtrl.OpenNonPDFUri(nonPdfContentUri, null);
To monitor the conversion event, do:
pdfViewCtrl.UniversalDocumentConversion += (sender, e) =>
{
if (e.State == PDFViewCtrl.ConversionState.Progress)
{
// conversion in progress
}
else if (e.State == PDFViewCtrl.ConversionState.Finished)
{
// conversion finished successfully
}
else if (e.State == PDFViewCtrl.ConversionState.Failed)
{
// conversion failed
}
}
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales