2

I am trying to reuse files in multiple documents, but I am having problems with the color profile file.

The idea is to have the .icc file in the icc folder inside the main folder and access that file from the different documents that I am going to create.

This is my code:

\usepackage[x-1a1]{pdfx}
\immediate\pdfobj stream attr{/N 4} file{../icc/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)%
}

Here file{../icc/ISOcoated_v2_300_eci.icc} I thought it would look for the file in the icc folder of the parent directory, but that doesn't happen, it tells me that it can't find the document. If I put the file in the folder where the .tex file is, the error disappears and the document compiles without problems.

How can I include the color profile from the icc folder of the parent directory?

This is my folder tree:

├── parent\
│   ├── ciclo-A\ 
│   │   ├── vol-1\
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── p01-chapter02.tex
│   │   │   └── p01-chapter01.tex
│   │   ├── vol-2\
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── p01-chapter02.tex
│   │   │   └── ...
│   │   └── vol-3
│   ├── ciclo-B\ 
│   │   ├── vol-1\
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── ...
│   │   ├── vol-2\
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── ...
│   ├── icc\ 
│   │   └── ISOcoated_v2_300_eci.icc
└── main-template.tex

Important clarification:

This is the order in which I link the files:

Suppose I am going to work on the document that I will create in vol-1.

One

In the file parent/ciclo-A/vol-1/00-main.tex I load the following:

% !TeX program = lualatex
%\documentclass[10pt,twoside,openany,showtrims,titlepage]{memoir}
\newcommand\theAuthor{ACG }
\newcommand\titleA{HD (A) *Documento Provisional*}
\newcommand\titleB{Adv}
\newcommand\theKeywords{Homilías\sep Liturgia\sep Cristianismo\sep Iglesia Católica}
\newcommand\theSubject{Esta obra recoge las homilías dominicales de los últimos papas. Contiene además las lecturas bíblicas según el nuevo Leccionario de la Misa, Comentarios Patrísticos a los Evangelios y los Temas del Catecismo de la Iglesia Católica sugeridos por el Directorio Homilético}
\newcommand\theOrg{www.example.org}
\newcommand\isCopyrighted{TRUE}
\newcommand\thePublicationType{Book}
\newcommand\theVolume{1}
\newcommand\thePublisher{example.org}
\newcommand\theYear{2021}
\newcommand\volume{Volumen 2}
\newcommand\subTitle{Textos bíblicos del nuevo Leccionario de la Misa, \\Comentarios Patrísticos a los Evangelios \\y Temas del Directorio Homilético}

\RequirePackage{filecontents} %if filecontents should overwrite old files

\begin{filecontents}{\jobname.xmpdata}
    \Title{\titleA \titleB}
    \Author{\theAuthor}
    \Volume{\theVolume}
    \Subject{\theSubject}
    \Keywords{\theKeywords} 
    \Org{\theOrg}
    \Copyrighted{\isCopyrighted}
    \PublicationType{\thePublicationType}
\end{filecontents}

\input{../../main-template} 

\begin{document}
    \mainmatter
    \label{files}
    \input{p01-chapter01}
    % ...
    
\end{document}

Two

As you can see, within 00-main.tex I load the file main-template.tex in this line: \input{../../main-template} and this is the file that loads the icc file:

main-template.tex:

\usepackage[x-1a1]{pdfx}
\immediate\pdfobj stream attr{/N 4} file{../icc/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)%
}
4
  • Maybe helpful: tex.stackexchange.com/a/448549/47927 Mar 30, 2021 at 21:20
  • @JasperHabicht I have tried \pdfxSetCMYKcolorProfileDir and \setCMYKcolorprofile without success.
    – A. Cedano
    Apr 1, 2021 at 20:01
  • I tested your set-up and it compiles nicely when using the correct relative path for the .icc file. On the basis of the directory structure you state above, you need to refer to the .icc file with parent/icc/ISOcoated_v2_300_eci.icc, so you need to use the path from main-template.tex and not from parent/ciclo-A/vol-1/00-main.tex, even if this is the file you want to compile. Apr 5, 2021 at 21:35
  • General comment: It is not always necessary to attach the *.icc file to PDF/X files, whether or not CMYK. You do need to specify an Output Intent. Always ask your print service whether or not to attach the profile. If the PDF/X does not have color, then almost certainly do NOT attach the *.icc profile.
    – rallg
    Apr 22, 2023 at 23:44

1 Answer 1

1

I don't know whether this can help you, since it does not use the pdfx package, but I once had a similar arrangement and used the hyperref package and XeLaTeX (it seems not to work with PDFLaTeX though) with the following set up. The .icc file is located in the parent directory of the .tex file.

\documentclass{article}
\usepackage[bookmarks=false]{hyperref}

\def\iccprofilepath{../PSOcoated_v3.icc}

\AtBeginDocument{
  \special{pdf:minorversion 3}
  \special{pdf:docinfo <<
   /GTS_PDFXVersion (PDF/X-1:2001)
   /GTS_PDFXConformance (PDF/X-1a:2001)
  >>}%
  \special{pdf:fstream @cmykdata (\iccprofilepath) <<
   /N 4^^J/Alternate/DeviceCMYK
  >>}%
  \special{pdf:put @catalog <<
   /PageMode /UseNone
   /OutputIntents [<<
    /Type /OutputIntent
    /S /GTS_PDFX
    /DestOutputProfile @cmykdata
    /OutputConditionIdentifier (PSOcoated_v3)
    /Info(PSO coated v3)
    /RegistryName (http://www.color.org/)
   >>]
  >>}%
}

\begin{document}

Hello World!

\end{document}
2
  • Nice suggestion, is this possible to implement this in LaTeX->dvips->PS2PDF (PS2PDF using Acrobat distiller) ?
    – MadyYuvi
    Oct 17, 2023 at 10:07
  • 1
    @MadyYuvi I don't think that this is possible, because you don't directly create a PDF using LaTeX this way. You would need to tell ps2pdf to include these, I would say. Oct 17, 2023 at 11:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .