Post date: Nov 18, 2016 4:46:13 PM
Overview
The ABCPDF plugin (qbo.Attachment.ABCPDF) has been enhanced to support the following features:
PdfConvert: an IService that attempts to convert files to PDF
PdfMerge: now supports merging Image files, marks invalid documents with a 'Invalid Source' status
All: supports async/await pattern for scalability
Updated to ABCPDF version 10
PDF Convert
This supports several file formats, including text, TIFF, HTML, PNG, JPEG, BMP, and PDF. The method signature to call is:
Attachment/ToPDF?ID={IdList}[&ThrowOnError={bool}][&Overwrite={bool}]
Optional Parameters:
ThrowOnError: if true, encountering an invalid document will throw an error. If false, no error is thrown
Overwrite: if true, the original file is overwritten with the PDF version. If false, a new Attachment is created
Application Settings:
ConvertOverwriteDefault: (True) if the Overwrite parameter is not specified, this default is used
ConvertOverwritePDFWithPDF: (True) if true, an attempt is made to convert a .PDF file to .PDF. This essentially validates the PDF.
ConvertThrowOnError: (False) if the ThrowOnError parameter is not specified, this default is used
PDF Merge
The PdfMerge plugin merges multiple documents into a single PDF. It expects a DataSet, DataReader, or XmlReader containing AttachmentIDs, and attempts to merge each Attachment into a single resulting PDF. The method signature to call is:
Attachment/Generate?Object={Object}&ObjectID={ObjectID}&Template={AttachmentTemlate}[&ThrowOnError={bool}]
where {AttachmentTemplate} used the plugin PDFMerge.
Optional Parameters:
ThrowOnError: if true, encountering an invalid document will throw an error. If false, no error is thrown
Application settings:
MergeThrowOnError: (False) if true, encountering an invalid document will throw an error. If false, no error is thrown
MergeErrorSourceStatus: (Invalid Format) the status to set a source document to if the source document cannot be merged into a PDF
MergeErrorStatus: (Invalid Format) the status to set the merged document to if any source documents cannot be merged into a PDF
Technical notes
For developers doing deployments:
Breaking Change: the URLtoPDF plugin has been moved to it's own project / plugin, since the install includes Firefox
Config/Generators.config may reference the old URLToPDF plugin. It must be removed.
Deploying FireFox for installs that don't use URLtoPDF is unnecessary overhead
The references to ABCPDF now uses NuGET, instead of needing to install the software outside of a build process
These plugins have been removed from the qbo.Core.sln, migrated to qbo.ABCPDF
Getting the ABCPDF NuGET package should be done from the ABCPDF solution
The folder structure has been cleaned up