Use CutePDF to Print to PDF/A for Free

Mark Berry April 12, 2013

I’ve been working on developing a paperless workflow. I want to save my digital files in PDF/A format, specially designed for archiving. (In particular, I want to create PDF/A-1b documents.) An important part of this workflow is the ability to print documents and emails to PDF/A. I found that with some tweaking, I can use CutePDF to do so. Here’s how.

Note This is a fairly advanced procedure and requires Administrator permissions.

CutePDF uses a program called Ghostscript to convert a printer file to PDF. If you don’t already have Ghostscript, CutePDF Writer 3.0 downloads Ghostscript 8.15. But you need Ghostscript 9.07 for this PDF/A conversion, so you need to install Ghostscript first.

1. If CutePDF is installed, uninstall it.

2. Download the GNU Affero-licensed version of Ghostscript 9.07 here. I found that the 32-bit version works fine even under 64-bit Windows 7. Install Ghostscript to the default directory, C:\Program Files (x86)\gs\gs9.07. At the end of the install, go ahead and let it Generate cidfmap for Windows CJK TrueType fonts.

CutePDF for PDFA 1

3. Download the free CutePDF Writer 3.0 here. Install it, but be very careful to uncheck all the extra software it will try to install:

CutePDF for PDFA 2

CutePDF for PDFA 3

The CutePDF installer should automatically find your Ghostscript 9.07 installation and should not prompt you to download Ghostscript.

4. Create an empty folder on your C: drive called C:\GS_PDFA (Ghostscript PDF/A).

5. Download the Adobe ICC profiles here. An ICC profile describes a “color space.” We’ll use the simplest one, Adobe RGB (1998). From the downloaded zip archive, extract AdobeRGB1998.icc to the C:\GS_PDFA folder.

6. Ghostscript needs some special instructions for creating PDF/A files. These are partially contained in a PDFA_def.ps file. For more information, see the sample file in your Ghostscript installation (C:\Program Files (x86)\gs\gs9.07\lib\PDFA_def.ps). Also see this bug report.

I’ve modified the sample to work with the 3-color RGB color space. In the C:\GS_PDFA folder, create an empty text file named PDFA_def.ps and paste in the following text. (Since this a derivative work of a file included with GNU Affero-licensed Ghostscript, please use it under the terms of the GNU Affero General Public License.)

/ICCProfile (C:/GS_PDFA/AdobeRGB1998.icc)   % Customize.
def

[ /Title (Title)                  % Customize.
  /DOCINFO pdfmark

% Define an ICC profile :

[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark
[{icc_PDFA} <</N systemdict /ProcessColorModel get /DeviceGray eq {1} {systemdict /ProcessColorModel get /DeviceRGB eq {3} {4} ifelse} ifelse >> /PUT pdfmark
[{icc_PDFA} ICCProfile (r) file /PUT pdfmark

% Define the output intent dictionary :

[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark
[{OutputIntent_PDFA} <<
  /Type /OutputIntent             % Must be so (the standard requires).
  /S /GTS_PDFA1                   % Must be so (the standard requires).
  /DestOutputProfile {icc_PDFA}            % Must be so (see above).
  /OutputConditionIdentifier (AdobeRGB1998)      % Customize
>> /PUT pdfmark
[{Catalog} <</OutputIntents [ {OutputIntent_PDFA} ]>> /PUT pdfmark

7. CutePDF also needs some instructions for printing to PDF/A. In the C:\GS_PDFA folder, create an empty text file named PDFWrite.pdfa.rsp. Open the file in Notepad and paste in this text

-sDEVICE=pdfwrite
-q
-dPDFSETTINGS=/default
-dAutoRotatePages=/All
-dNOPAUSE
-dBATCH
-dPDFA
-dNOOUTERSAVE
-sProcessColorModel=DeviceRGB
-dUseCIEColor
-dPDFACompatibilityPolicy=1
"C:\GS_PDFA\PDFA_def.ps"

8. The second part of the instructions for CutePDF must be added to the CutePDF installation folder, C:\Program Files (x86)\Acro Software\CutePDF Writer. You will need Administrator permissions.

Create an empty text file in that folder named setup.ini. Run Notepad as Administrator, open the file, and paste in this text:

[Parameters]
Command="C:\Program Files (x86)\gs\gs9.07\bin\gswin32c.exe"
Arguments=-sOutputFile="%1" @"C:\GS_PDFA\PDFWrite.pdfa.rsp" -

This tells CutePDF where to find your Ghostscript installation and what arguments to pass to it. We are basically telling it to use the commands in our custom PDFWrite.pdfa.rsp, which will in turn load the special PDFA_def.ps file before loading the iniput stream. And yes, the last line in setup.ini ends in a hyphen (-)!

Print to PDF/A

That’s it! Now, when you print using CutePDF, the file should be created in PDF/A-1b format. After opening in Adobe Reader, you’ll see a blue bar at the top:

CutePDF for PDFA 4

Note that this message, in spite of what it says, does not guarantee compliance with the standard. To test compliance, you can use Adobe Acrobat’s pre-flight testing (Acrobat offers a 30-day free trial). You can also try a free online validator like the one at PDF-Tools.com or the one at intarsys.de (German). In my testing, files created with Ghostscript passed the Acrobat and PDF-Tools tests, but failed the intarsys test with font errors.

Print to Plain PDF

If you want to go back to printing to plain PDF from CutePDF, in the CutePDF installation folder, just rename setup.ini to setup.pdfa.ini. CutePDF will then use its default settings. You can leave the C:\GS_PDFA folder set up so all you need to do for PDF/A printing is to rename setup.pdfa.ini back to setup.ini.

Converting PDF to PDF/A

If you already have a text-based (searchable) PDF file, perhaps received from a bank or utility, you can convert it to PDF/A without printing with CutePDF. See Batch Convert PDF to PDF/A.



1 Comment

  1. Batch Convert PDF to PDF/A | MCB Systems   |  April 15, 2013 at 8:38 pm

    […] Non-PDF electronic documents like emails, web pages, etc. These already have text; they just need to be converted to PDF/A. I’ve already blogged about using CutePDF to print these to PDF/A. […]

Leave a Reply





*