11

I am trying to get a PDF/X-1a compliant PDF for sending the pdf to Lightning Source for publishing books.

I searched and found the following post and tested it

PDF/A with hyperref on TeX Live 2013

And ran the following code in TexStudio

% ===============================
% Filename: test.tex

\documentclass{article}

% ===============================
% Embedding the color profile.
% Requires eciRGB_v2.icc in the working directory
% http://www.eci.org/_media/downloads/icc_profiles_from_eci/ecirgbv20.zip


\pdfminorversion 4
\immediate\pdfobj stream attr{/N 3}  file{eciRGB_v2.icc}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \the\pdflastobj\space 0 R
/OutputConditionIdentifier (eciRGB v2)
/Info(eciRGB v2)
>> ]
}

\usepackage{xcolor}
\usepackage{hyperxmp}
\usepackage[pdftex, pdfa, linktoc=none]{hyperref}

% ----------------------------------------------
% Add metadata

\hypersetup{%
   pdftitle={Title},
   pdfauthor={Author},
   pdfauthortitle={Title of the Author},
   pdfcopyright={Copyright (C) 20xx, Copyrightholder},
   pdfsubject={Something},
   pdfkeywords={Keyword1, Keyword2},
   pdflicenseurl={http://creativecommons.org/licenses/by-nc-nd/3.0/},
   pdfcaptionwriter={Scott Pakin},
   pdfcontactaddress={Street},
   pdfcontactcity={City},
   pdfcontactpostcode={101},
   pdfcontactcountry={Country},
   pdfcontactemail={email@institute.edu},
   pdfcontacturl={http://www.institute.edu},
   pdflang={en},
   bookmarksopen=true,
   bookmarksopenlevel=3,
   hypertexnames=false,
   linktocpage=true,
   plainpages=false,
   breaklinks
 }

\begin{document}
What cat says? \label{meow}
See question on page \pageref{meow}.
\end{document}

Then ran the Preflight in Adobe Acrobat Pro XI, for PDF/A-1b varification, it came out with no problems.

how changes do we have to make it to work with PDF/X-1a and PDF/X-3?

Is there a way to get PDF/X-1a fully compliant pdf with PDFLaTex or XeLateX or LuaLaTeX?

Ibn Saeed
  • 531
  • 1
    If you have access to Adobe Acrobat Pro, you can run "preflight" and fix your PDF right there... – DG' May 05 '15 at 19:03

1 Answers1

12

Update: Since the original answer, the PDF api in luatex changed. In order to use this code you have to load luatex85

This should do the trick for PDF/X-1a (you need ISOcoated_v2_300_eci.icc in the current directory):

% ===============================
% Filename: test.tex

\documentclass{article}

% =============================== % Embedding the color profile. % Requires ISOcoated_v2_300_eci.icc in the working directory % http://www.eci.org/_media/downloads/icc_profiles_from_eci/eci_offset_2009.zip

\usepackage{luatex85} \pdfpageattr{/MediaBox[0 0 595 793] /BleedBox[0 0 595 793] /TrimBox[25 20 570 773]}

\immediate\pdfobj stream attr{/N 4} file{ISOcoated_v2_300_eci.icc} \pdfcatalog{% /OutputIntents [ << /Type /OutputIntent /S/GTS_PDFX /DestOutputProfile \the\pdflastobj\space 0 R /OutputConditionIdentifier (ISO Coated v2 300 (ECI)) /Info(ISO Coated v2 300 (ECI)) /RegistryName (http://www.color.org/) >> ] } \pdfinfo{% not needed with newer PDF/X versions /GTS_PDFXVersion (PDF/X-1:2001)% /GTS_PDFXConformance (PDF/X-1a:2001)% }

\usepackage[cmyk]{xcolor} \usepackage{hyperxmp} \usepackage{hyperref}

\hypersetup{% pdfxstandard=PDF/X-1a:2001, pdfstartpage={} }

\title{Title}

\begin{document} \begin{NoHyper} What cat says? \label{meow} See question on page \pageref{meow}. \end{NoHyper} \end{document}

Works with pdflatex and lualatex but not xelatex.

tanGIS
  • 1,645
  • 15
  • 32
DG'
  • 21,727
  • Thanks this works great. Now i have to test it out with Amazon Createspace. Also, is there a way to get it to work with XeLaTeX since i will be using custom fonts for thr projects. Or is there a way to use custom fonts with PDLaTeX – Ibn Saeed May 06 '15 at 04:34
  • 1
    One more question, how did you find out the above commands would work for pdf/x-1a complaince ? Is there any site which gives such information. – Ibn Saeed May 06 '15 at 04:36
  • 1
    With luatex you can use any font you want. – DG' May 06 '15 at 06:59
  • This page may help: http://stackoverflow.com/questions/569129/how-can-i-test-a-pdf-document-if-it-is-pdf-a-compliant – gsl May 18 '15 at 08:16
  • @DG' Testing your code here: http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx reports: " The key Metadata is required but missing. The key MarkInfo is required but missing. A device-specific color space (DeviceCMYK) without an appropriate output intent is used. The key ToUnicode is required but missing. The document does not conform to the requested standard. The document contains device-specific color spaces. The document contains fonts without appropriate character to unicode mapping information (ToUnicode maps). The document's meta data is either missing or inconsistent or corrupt." – gsl May 18 '15 at 08:21
  • 1
    @gsl the site tests PDF/A compliance, not PDF/X. For PDF/A use this code: tex.stackexchange.com/a/136653/29873 – DG' May 19 '15 at 12:23
  • 2
    @DG': Wonderful. I just tested you answer using Acrobat Pro 11, and it works flowlessly. Until now, we had to keep a windows laptop around just for this, now we can go full FreeBSD. Thanks! – gsl May 19 '15 at 16:40
  • @DG' You can use this answer to set all boxes automatically. – Kpym Jun 06 '15 at 13:45
  • 1
    There is some confusion regarding PDF/X-1a versus PF/A-1b. These are very different. For printing, you need X-1a (or sometimes X-3). The A-1b specification is for an archival digital file (nothing to do with print). Lightning Source wants X-1a. You might also need to use a different output intent (USWebCoatedSWOP.icc) if your printing is in the USA. – RobtA Jun 11 '15 at 00:58
  • 1
    @ibn Saeed: Yes, custom fonts can be used with pdflatex. I have done it, using Adobe Garamond Pro. However, pdflatex can only reach a 1-byte character set, even if your input encoding is utf8. So, this is good for Western Euopean languages, not good otherwise, unless you have a font encoding that maps characters down to Latin-1 or ANSI. The technology involves using LCDF Typetools (otftotfm) to decompose an Open Type font into format for TeX. It allows you to make several versions, with different Open Type features. Probably better to use XeTeX if you can. – RobtA Jun 11 '15 at 14:46
  • 2
    concerning [tag:xetex], this question might help – Tobias Kienzler Nov 18 '15 at 09:23
  • With LuaLaTeX, Version 1.0.4 (TeX Live 2017), this doesn't work. I get Undefined control sequence for \pdfpageattr and I do not know how to get pass that. I had same error for \pdfminorversion=3, but solved it by replacing it with \pdfvariable minorversion=3. – Rafal Jul 05 '17 at 12:08
  • 1
    @Rafal thanks for bringing up the issue. Indeed the luatex api changed since writing the answer. Fortunately backward compatibility can be restored with the luatex85 package. – DG' Jul 06 '17 at 18:57
  • requested edit. draft mode in hyperref is not the way to go to disable bookmarks and links while keeping XMP. Also, newer PDF/X standards do not need \pdfinfo they store it in XMP only which is handled by hyperref. – tanGIS Jul 03 '20 at 14:00
  • @tanGIS - Thanks for keeping an eye on those outdated pdf/a and pdf/x issues – DG' Jul 03 '20 at 21:41
  • Hello. I have downloaded ISOcoated_v2_300_eci.icc and can generate a pdf. My intention is to print it in Ingramspark, but, seeing that the profile has a TAC of 300 and that IngramSpark says the following: "Files sent with densities higher than 240% may be rejected for correction. Files with densities greater than 240% may process and print without rejection. If these files with densities over 240% encounter print issues in future orders,LS will require a corrected file from the customer" (source) ... – A. Cedano Feb 14 '21 at 12:24
  • ... I'm wondering if this file could be rejected by Ingramspark, due to exceeding the maximum allowed TAC. Any experience or profile recommended for IngramSpark? It is a book with text in black, with some letters in red (very little) and with monochrome images. – A. Cedano Feb 14 '21 at 12:24
  • @A.Cedano – Ingramspark is some kind of printing service? If so, do contact them. They are the ones who know fro sure, what color profiles they need. – DG' Feb 14 '21 at 14:34
  • @DG' Your solution is superb, is this possible to fix this by using PDFLaTeX and LaTeX -> dvips -> PS2PDF and XeLaTeX? Please suggest.... – MadyYuvi Jul 30 '21 at 10:26
  • @MadyYuvi – This answer is very old, you should try pdfx or search for more recent questions like this one: https://tex.stackexchange.com/questions/545903/creating-a-pdf-a-pdf-x-and-pdf-ua-multistandard-compliant-thesis-or-paper/545904#545904 – DG' Aug 01 '21 at 16:42
  • @DG' Suggested link is helping a lot....Much thanks... – MadyYuvi Aug 02 '21 at 03:36