I am currently having an issue where when importing PDF through snapshot or generating pages provides the same quality as the original PDF. The issue is when trying to export via SDK through workflow and through visual studio. The exported document was slightly degraded in quality. The current version that is being used is version 9.2.0 via workflow. if there are any suggestions for the function call ExportPdf that would assist with the image quality that would be helpful.
Question
Question
Replies
ExportPdf uses the image pages to construct a new pdf, which can be quite different from the original. If the efile part of the document is already a pdf, you probably just want to get that data directly.
If the original PDF is stored into Laserfiche as an electronic document
To echo Brian's answer, if the original PDF is stored into Laserfiche (as an electronic file), it can be exported via SDK without modification with the following code:
DocumentExporter docexp = ... ; docexp.ExportElecDoc(docInfo, outputFile);
To check whether a Laserfiche document contains the original PDF as an electronic document, open the Document Properties from Client Folder Browser and select the Document tab.
If the original PDF has not been stored into Laserfiche
PDF is a document format that allows mixed content types to be composed into a document page.
Some content types, such as text in TrueType font and vector graphics, can be rendered at any resolution (measured in dots per inch, or DPI) without losing sharp edges.
When an image is added to a PDF and then resized using a PDF authoring software, the PDF software typically does not alter the image's pixel dimensions. Instead, the image is aligned and rendered to its new size, at a resolution that is much higher or lower than its original resolution.
When a PDF is imported into Laserfiche, the Generate Pages option causes Laserfiche to create a rasterization of the PDF. Rasterization means that all contents inside a PDF are to be rendered at a fixed resolution. The default is 300 DPI. This value is configurable as a user attribute.
[Settings]PdfImportResolution
The rasterized page images might be stored in one of the three formats: TIFF Group 4 Fax (when the monochrome option is chosen), TIFF LZW (when the lossless color option is chosen), or JPEG (when the lossy color option is chosen). A quality level setting is used along with JPEG. Some of these options are controlled by user attributes; others might be hard-coded. The behavior may be different between each product, and may have been changed in recent versions.
Even if the generated pages are stored with the lossless color option, when a user performs an Export to PDF command, the PDF generation library will be given the choice of converting between TIFF LZW and JPEG for color images. If the exported PDF is significantly smaller than the sum of page images (as reported in the Document Properties dialog inside the Laserfiche Document Viewer), it is likely that a conversion into JPEG has occurred.
When the PDF export is performed manually via the Client, the following options are applied (highlighted in the image below):
When using the Laserfiche RepositoryAccess and DocumentServices SDK, the JPEG quality level can be configured using the following property: (minimum 0, maximum 100)
DocumentExporter docexp = ...; docexp.CompressionQuality = 100;
Alternatively, you can enable the PDF/A option to force DocumentExporter to use a lossless image format for PDF export.
Note that DocumentExporter.PageFormat is ignored when the ExportPdf command is used.
Information on this answer may be subject to further review and corrections.
Currently the customer has the process where they do not want the original PDF in Laserfiche and only the Laserfiche pages. There is an automated process that is done where they want the document as a PDF. I have done what you have said about the change in the compression though I am still getting about the same pixilation. If there is another way to increase the quality of the Laserfiche pages when they are generated that would possibly help with this. Also to note the size is much different after being exported.
Pixilation is due to the choice of DPI value during rasterization, which occurs in the "Generate Pages" step (also commonly known as "PDF Import").
After the rasterization of PDF into an image, the pixilation effect cannot be reversed. However, certain image processing software can apply "resize with interpolation" to reduce the visual impact of pixilation via a small amount of blurring.
Changing the rasterization DPI when importing PDF into Laserfiche Client
To configure rasterization with a higher DPI (resolution), please increase the value of the following user attribute:
[Settings]PdfImportResolution
Changing the value from 300 to 600 will halve the size of pixilation artifacts. However, doing so will increase the image file size greatly, which will take up a lot of repository volume space. It will also increases the amount of RAM needed for computers performing the PDF Import and viewing the page images.
Changing the rasterization DPI when importing into Laserfiche Snapshot
Please follow the instructions in the article linked below:
https://answers.laserfiche.com/questions/70742/Snapshot-dpi-changing-to-600-dpi-from-300-dpi
Other options and general advice
A lot of use cases and integration scenarios must be considered when deciding whether to keep or discard the original PDFs when they are imported into Laserfiche. Because each customer's considerations are different, it is somewhat difficult to provide comprehensive actionable advice on this issue while keeping the advice succint.