[]
FlexViewer allows you to export a PDF document and save it to a file, stream or as an image(s). You can export the PDF documents using Export command button from the hamburger menu. Alternatively, you can export a document and save it to a file, stream or as an image programmatically using Save method of the FlexViewer class to save a PDF document to a file or a stream. In addition, you can use various methods provided by the FlexViewer class to save a PDF document as an image. These methods are listed in the following table:
Methods | Description |
---|---|
SaveAsBmp | Saves the document pages as images in BMP format, i.e., one image for each page. |
SaveAsGif | Saves the document pages as images in GIF format, i.e., one image for each page. |
SaveAsJpeg | Saves the document pages as images in JPEG format, i.e., one image for each page. |
SaveAsPng | Saves the document pages as images in PNG format, i.e., one image for each page. |
SaveAsTiff | Saves the document pages as images in TIFF format, i.e., one image for each frame. |
The following code illustrates how to export PDF pages to images. This example uses the sample code created in Quick Start section.
string PathAndName = string.Empty;
PathAndName = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.ToString(), "ExportedPdf") + "." + "png";
flexViewer.SaveAsPng(PathAndName);