[XeTeX] PDF/X-1a preflight & \special

dgatwood at mac.com dgatwood at mac.com
Tue Dec 11 09:52:18 CET 2012


In the category of (maybe) "better late than never":



On Tue Nov 30 21:51:24 CET 2010, Juan Acevedo wrote:

> I found in the web a generous sample file by Eric Jeschke containing these lines:
> 
> -------------------
> \special{pdf:docinfo <<
>/Title (My Book)   % set your title here
> /Author (Som Wan)       % set author name
> /Subject (What Ever)          % set subject
> /Keywords (Blah, Blah) % set keywords
> /Trapped (False)
> /GTS_PDFXVersion (PDF/X-1a:2001)
> %/TrimBox [0.00000 9.00000 684.36000 585.00000]
>  >>
> }
...

> --Trimbox

If you have only a single crop box, then as Peter Dyballa suggested:

	\usepackage{atbegshi}
	\AtBeginShipout{\special{pdf: put @thispage <</TrimBox [9.0 9.0 621.0
	801.0]>>}}
	
However, if you need different crop boxes on odd/even pages, then you can also do something more drastic, e.g.:

    \AddToShipoutPicture {%
        \special{ pdf: put @thispage << /MediaBox [ 0 0 \novelPageWidthInPoints\space \novelPageHeightInPoints\space ] >>}
        \ifodd\count1%
                \special{ pdf: put @thispage << /TrimBox [ \novelInsideCropMarginInPoints\space \novelBottomCropMarginInPoints\space \novelPageWidthInPoints\space \novelPageHeightInPoints\space ] >>}
                \special{ pdf: put @thispage << /BleedBox [ \novelInsideCropMarginInPoints\space \novelBottomCropMarginInPoints\space \novelPageWidthInPoints\space \novelPageHeightInPoints\space ] >>}
        \else%
                \special{ pdf: put @thispage << /TrimBox [ 0 \novelBottomCropMarginInPoints\space \novelLogicalPageWidthInPoints\space  \novelPageHeightInPoints\space ] >>}
                \special{ pdf: put @thispage << /BleedBox [ 0 \novelBottomCropMarginInPoints\space \novelLogicalPageWidthInPoints\space  \novelPageHeightInPoints\space ] >>}
        \fi%
    }

Where \novelInsideCropMarginInPoints et al are purely numeric values... in points, as the names imply, and \space is an abusive little macro to prevent LaTeX from closing up the space between the macros, and looks like this:

  \def\space{ }

There's probably a better way, but....  :-D


> --Date

The \pdfdate commend can generate these.  To modify your previous example slightly:

    \usepackage{datetime}

    \special{pdf:docinfo <<
        /Title (\printTitle)
        /Author (\printAuthor)
        /Subject (Fiction Novel)
        /Keywords ()
        /Trapped /False
        /GTS_PDFXVersion (PDF/X-1a:2001)
        /GTS_PDFXConformance (PDF/X-1a:2001)
        /CreationDate (D:\pdfdate)
        /ModDate (D:\pdfdate)
     >>}



> --Trapped key: this won't work, no matter what I input above

Unless they fixed a bug or something, I suspect the problem is because the syntax should be:

    /Trapped /False

If you do that instead of /Trapped (False), it works, at least for me.


> --Compressed object streams: I only have two greyscale .pdf images in the book, inserted via \includegraphics

I suspect the answer is "Change the source PDF images to not contain compressed streams," but I'm uncertain about this one.


Also, if you're trying to get PDF/X-1a compliance, you may need to do this:

    \usepackage[cmyk]{xcolor}

early on to ensure that the PDF file uses the CMYK color model where possible.  I'm not sure if that affects included graphics or not, but it probably won't hurt.  :-)

Thanks for the info about /OutputIntents, BTW.  That helped a lot, and the other bits got me a lot closer to compliance.  At this point, the only remaining compliance problem in my content is the missing document ID (which I just emailed the tex-live mailing list about).


David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20121211/eda40971/attachment.html>


More information about the XeTeX mailing list