Convert .pages documents to PDF/A documents

Joined
Feb 10, 2021
Messages
2
Reaction score
0
Hi, I noticed that in macOS Big Sur, Apple added the possibility to export PDFs as PDF/A documents, which is great and I appreciate it. Was wishing for this for years!

However, I could not find any documentation for this and especially, I would like to integrate this capability into my AppleScripts, where I convert my Pages documents directly to PDF. The upgrade should convert to PDF/A, but I cannot find the right script language. Could you please help me with this? Thanks! I'm attaching a screenshot with the new option in Preview.

This is the script I use now, but this only convert to a plain old PDF, but I need the archival version PDF/A:

AppleScript:
on run {input, parameters}
    
    repeat with theFile in input
        tell application "Finder"
            set theFilesFolder to (folder of theFile) as text
            set extension hidden of theFile to true
        end tell
        
        tell application "Pages"
            set theDoc to open theFile
            set theDocName to name of theDoc
            set theName to (characters 1 thru -1 of theDocName) as text
            export theDoc as PDF to file ((theFilesFolder & theName & ".pdf") as text)
            close theDoc
        end tell
    end repeat
    return input
end run
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,098
Reaction score
500
Hello and welcome.

I am not very experienced at all with Automator/AppleScript. We have some members that may be able to help, or you can try with the folks over at MacScripter.

Be well,

C
 
Joined
Feb 14, 2021
Messages
1,066
Reaction score
140
Hi, I noticed that in macOS Big Sur, Apple added the possibility to export PDFs as PDF/A documents, which is great and I appreciate it. Was wishing for this for years!

However, I could not find any documentation for this and especially, I would like to integrate this capability into my AppleScripts, where I convert my Pages documents directly to PDF. The upgrade should convert to PDF/A, but I cannot find the right script language. Could you please help me with this? Thanks! I'm attaching a screenshot with the new option in Preview.

This is the script I use now, but this only convert to a plain old PDF, but I need the archival version PDF/A:

AppleScript:
on run {input, parameters}
 
    repeat with theFile in input
        tell application "Finder"
            set theFilesFolder to (folder of theFile) as text
            set extension hidden of theFile to true
        end tell
    
        tell application "Pages"
            set theDoc to open theFile
            set theDocName to name of theDoc
            set theName to (characters 1 thru -1 of theDocName) as text
            export theDoc as PDF to file ((theFilesFolder & theName & ".pdf") as text)
            close theDoc
        end tell
    end repeat
    return input
end run
I only dared to write some simple scripts before, and in this instance, I don’t see any need for it.

From Pages, with the document in question open and saved, go to File -> Print… and the print window will open. Click on the PDF pulldown button, go down to Save as Adobe PDF > Save as Adobe PDF and a separate settings window will open where you can select the PDF format that you want. Mind you, PDF/A-1b:2005 has two flavors: RGB and CMYK.

This also applies to any app that supports the standard macOS print dialog that features the PDF option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top