Allow PDF/A as target for getFileAsync

Allow PDF/A as target for getFileAsync
35

Upvotes

Upvote

 Jul 20 2021
4 Comments (4 New)
New

The Office.context.document.getFileAsync-API already supports PDF export. Unfortunately, the file format is PDF 1.8 whereas we need a PDF/A compatible export. It is possible to specify PDF/A when saving the PDF manually through the "Options" dialog in the Office application. Unfortunately, there is no (documented) way to specify the type of PDF in the getFileAsync-API. It would be great, if the API is expanded so that PDF/A compatibility can be requested as well (either with a new file format flag or as an option in the optional GetFileOptions-object).

Comments
Iron Contributor

We also support this idea and we would love to extend the options to cover all the PDF export attributes: pages to include, properties, image quality, etc. Basically, extending the API with similar options as the old Saveas2 method in VBA, but for the JS API. This should include the export differences of PDF options for Word, Excel, and PowerPoint.

 

Thank you!

 

Word:

jaime_from_synergy_0-1650565069182.png

 

PowerPoint:

jaime_from_synergy_1-1650565119197.png

 

Excel:

jaime_from_synergy_2-1650565140542.png

 

 

Brass Contributor

@lindalu-MSFT 
This would be a great extension, not being able to create a pdf/a is a showstopper for many public sector applications since they require using pdf/a instead of plain pdf files.

Copper Contributor

I think you want to convert opened office document to PDF! this is already done in  Office.context.document.getFileAsync  
see this 
https://learn.microsoft.com/en-us/javascript/api/office/office.document?view=word-js-1.3#office-offi... 

get document base64 Office.context.document.getFileAsync(Office.FileType.Pdf and convert base64 to pdf.

Brass Contributor

@M-Junaid There are different variants of the PDF-standard and PDF/A is one of them that is for long term archiving (https://en.wikipedia.org/wiki/PDF/A). In this standard many requirements must be met, e.g. embedding fonts and do not use certain features. The Office apps (on the client) and therefore the COM APIs support creating a pdf file conforming to this standard, and this issue is about supporting this in the js API as well.