PdfConvertHelper.ConvertImageToPdf(".path to valid Image 2.", pageSizeInfo), PdfConvertHelper.ConvertImageToPdf(".path to valid Image 1.", pageSizeInfo), Sample for Converting Image to Pdf Document: var pageSizeInfo = new PdfResizeInfo(PageSize.POSTCARD, PdfMarginSize.None) This also enables the output document to be optimized without unnecessary duplicate references to embedded elemetns such as Fonts. Therfore, assuming they haven't been scaled/resized the annotations and dynamicĮlements will be preserved. NOTE: This uses the PdfSmartCopy underlying copier to merge the documents. When combined with the Convert helper above it'sĮasy to append Image files onto an existing Pdf). Set of helpers for merging Pdf documents together into one output Pdf. Var pdfBytes = PdfConvertHelper.ConvertImageToPdf(imageBytes, pageSizeInfo, PdfScalingOptions.Default) Var pageSizeInfo = new PdfResizeInfo(PageSize.POSTCARD, PdfMarginSize.None) Sample for Converting Image to Pdf Document: var imageBytes = File.ReadAllBytes(".path to valid Image.") converting an Image into Pdf for mergeing/Combining into other Pdf documents. Set of helpers for converting common things into Pdf (e.g. Var targetSizeInfo = new PdfResizeInfo(PageSize.POSTCARD, PdfMarginSize.None) īyte scaledPdfBytes = PdfResizeHelper.ResizePdfPageSize(pdfBytes, targetSizeInfo, PdfScalingOptions.Default) ![]() ![]() Sample for Resizing Pdf Content: byte pdfBytes = File.ReadAllBytes(".path to pdf.") In addition, this library is intented to help simplify the task of rendering Pdf based outputs/reports and works best whenĬombined with a template based Pdf Rendering process such as the one here that allows use of Razor templates to render Pdf files. It leverages iTextSharp for core work but offeres a easy wrapper for common Lightweight Helper Library for performing tasks on Pdf files such as: scaling and resizing Pdf Documents and Pages of existing Pdf documents, converting Images into Pdfįormat, and merging Pdf Documents as well as merging Images into Existing Pdf documents.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |