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 the official Wikipedia definition.
Now that we have a got our head around PDF/A, let’s build our Flow!
Please make sure the following prerequisites are in place:
- An Office 365 subscription with, SharePoint Online license.
- PDF Converter Services Online Full or Trial subscription (Sign up).
- Appropriate privileges to create Flows.
- Working knowledge of SharePoint Online and Microsoft Flow.
In this example, we will upload our document to a SharePoint document library. Our Flow will process that file, convert it to PDF/A and store the generated file back in SharePoint.
From a High-Level, our Flow looks as follows:
Step 1: For this demo, we will use the “When an item is created or modified” SharePoint Trigger.
Specify the path to the SharePoint Online Library to monitor for new items.
Step 2: Add the Muhimbi “Convert document” action.
- Source file name: “File Name” (output of the “When a file is created or modified in a folder” trigger).
- Source file content: “File Content” (output of the “When a file is created or modified in a folder” trigger).
- Output format: PDF
- Override settings:
<Override> <ConversionSettings> <!-- Set the output profile --> <PDFProfile>PDF_A2B</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/A2b standard. The ‘PDFProfile’ element supports the following values:
- 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 generated PDF document to the 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! Upload a file to the source library. After a few seconds the generated PDF/A file will be written to the destination library.
Please note that PDF/A Conversions require a Professional subscription or higher. For details see the overview of subscription tiers.