In this blog post, I will demonstrates how to convert a document to PDF/A(ISO-standardized version of the Portable Document Format) with the help of Microsoft Flow.
Before we begin, lets try and understand “What does PDF/A aim to achieve?”
PDF/A aims to produce files with static content that can therefore be visually reproduced completely precisely today and in many years time. Files that are subject to long-term archiving should work regardless of the device or operating system used. The future usability of PDF/A files must also be guaranteed in a manufacturer-independent manner – and this includes Adobe. PDF/A is a ‘complete’ format. This means that PDF files that comply with the PDF/A standard are complete in themselves and use no external references or non-PDF data. The PDF/A-1 standard is based on PDF/A specification 1.4, which means that it works within the technical scope of the functions available in Acrobat 5.
A range of rules must be observed when generating PDF/A files in order to meet the goals named above. For example, when generating PDF/A, it is important to embed all fonts and clearly specify all colors. Forms, comments, and notes are only permitted to a limited extent. Compression is allowed as a general rule, but LZW and JPEG2000 are excluded. Transparent objects and layers (Optional Content Groups) are not permitted. PDF/A uses rules for metadata that are based on XMP (Extensible Metadata Platform). Finally, a PDF/A file must identify itself as such?
For more details, see Wiki Article (https://en.wikipedia.org/wiki/PDF/A)
Now that we have a got our head around PDF/A, let start building our Flow!
Please make sure the following prerequisites are in place:
- An Office 365 subscription with, SharePoint Online license.
- Muhimbi PDF Converter Services Online full, free or trial subscription(Sign up).
- Appropriate privileges to create Flow.
- Working knowledge of SharePoint Online and Microsoft Flow.
In this example, we will upload our document to a SharePoint document library(Source). Our Flow will get a file from a SharePoint document library, convert it to PDF\A and store generated file back to SharePoint document library(Achieve).
From a High-Level our Flow would look like!
Step 1: For this demo, we will use “When an item is created or modified” SharePoint ‘Flow Trigger’ action.
In the action, specify the path to the SharePoint Online List to monitor a new item.
Step 2: Add the Muhimbi “Convert document” action.
- Source file name: “File Name”(the output of the SharePoint “When a file is created or modified in a folder action”).
- Source file content: “File Content” (the output of the SharePoint “When a file is created or modified in a folder action”).
- Output format: PDF
- Override settings:
<Override> <ConversionSettings> <!-- Set the output profile --> <PDFProfile>PDF_A1B</PDFProfile> <!-- Force post processing --> <OutputFormatSpecificSettings type="OutputFormatSpecificSettings_PDF"> <FastWebView>false</FastWebView> <EmbedAllFonts>true</EmbedAllFonts> <SubsetFonts>false</SubsetFonts> <PostProcessFile>true</PostProcessFile> </OutputFormatSpecificSettings> </ConversionSettings> </Override>
This will make sure that all converted files conform to the PDF/A standard. The PDFProfile element supports the following values, please note that the use of this functionality requires a Muhimbi PDF Converter Professional license.
- PDF_A1B: Use the PDF/A1b standard for long term archiving.
- PDF_A2B: Use the PDF/A2b standard for long term archiving.
- PDF_A3B: Use the PDF/A3b standard for long term archiving.
- PDF_1_1: PDF 1.1 output (Compatible with Acrobat 2.0 (1994) and later).
- PDF_1_2: PDF 1.2 output(Compatible with Acrobat 3.0 (1996) and later).
- PDF_1_3: PDF 1.3 output (Compatible with Acrobat 4.0 (2000) and later).
- PDF_1_4: PDF 1.4 output (Compatible with Acrobat 5.0 (2001) and later).
- PDF_1_5: PDF 1.5 output (Compatible with Acrobat 6.0 (2003) and later).
- PDF_1_6: PDF 1.6 output (Compatible with Acrobat 7.0 (2005) and later).
- PDF_1_7: PDF 1.7 output (Compatible with Acrobat 8.0 (2006) and later).
Step 3: Use the “Create file” SharePoint action to write the PDF document to the SharePoint document library.
- File name: “Base File name.pdf” (output variable of the “Convert document”)action.
- File content: “Processed file content” the (output variable of the “Convert document”)action.
All Done! The “Create file” action from SharePoint connector should Create the PDF\A Compliant document in SharePoint “Archive” document library. Happy Converting..