Export PDF using Format Specific Filter
In This Topic
PdfDocumentSource provides support for exporting a PDF file to an external format through Export method inherited from C1DocumentSource class.
To export PDF to HTML format
- Add a button control to the design view for exporting PDF.
- Switch to the code view and add the following namespaces in the code view.
- Add a PDF file to the project. In our case, we have used PDF file named DefaultDocument.pdf.
- Initialize the instance of C1PDFDocumentSource class using the following code:
- Load the PDf file into the object of C1PdfDocumentSource using the LoadFromFileAsync method.
- Add the following code to the button's click event to export the PDF to HTML format using HtmlFilter class.
To export PDF to an image file format
Similar code as above can be used for exporting a PDF document to a series of page image files in one of the supported image formats (JPEG, PNG, TIFF, etc.). It is also possible to create a single ZIP file containing the page images. The following code uses one of the image format filter class, JpegFilter, to export the multi-paged file to JPEG format and creates a single ZIP file of the exported images.
See Also