[gs-cvs] rev 6477 - in trunk/gs: doc lib
leonardo at ghostscript.com
leonardo at ghostscript.com
Thu Jan 19 22:43:12 PST 2006
Author: leonardo
Date: 2006-01-19 22:43:12 -0800 (Thu, 19 Jan 2006)
New Revision: 6477
Modified:
trunk/gs/doc/Ps2pdf.htm
trunk/gs/lib/gs_pdfwr.ps
Log:
Fix (pdfwrite, PDF/X) : Implement TrimBox, BleedBox and related Distiller parameters.
DETAILS :
Bug 688443 "TrimBox values should be customizable for PDF/X document".
Patch from Gunnar Ritter with minimal adoptation and a minimal testing.
We added sscanf to acquire TrimBox from Postscript.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/doc/Ps2pdf.htm
===================================================================
--- trunk/gs/doc/Ps2pdf.htm 2006-01-20 06:38:30 UTC (rev 6476)
+++ trunk/gs/doc/Ps2pdf.htm 2006-01-20 06:43:12 UTC (rev 6477)
@@ -274,6 +274,13 @@
defined.
<li> Transfer functions and halftone phases are being skipped.
<li> <b><tt>/PS pdfmark</b></tt> interpretes the <b><tt>DataSource</b></tt> stream or file.
+<li><b><tt>TrimBox</b></tt> and <b><tt>BleedBox</b></tt> entries
+are generated in page descriptions.
+Their values can be changed using the
+<b><tt>PDFXTrimBoxToMediaBoxOffset</b></tt>,
+<b><tt>PDFXSetBleedBoxToMediaBox</b></tt>, and
+<b><tt>PDFXBleedBoxToTrimBoxOffset</b></tt>
+distiller parameters (see below).
</ul>
@@ -771,6 +778,44 @@
<p>Ghostscript distribution does not contain an ICC profile to be used
for creating a PDF/X-3 document. Users should either create an appropriate one themselves,
or use one from a public domain, or create one with the PDF/X-3 inspector freeware.
+
+<p>The PDF/X-3 standard requires a <b><tt>TrimBox</b></tt> entry
+to be written for all page descriptions.
+This is an array of four offsets
+that specify how the page is to be trimmed
+after it has been printed.
+It is set to the same as <b><tt>MediaBox</b></tt> by default
+unless the <b><tt>PDFXTrimBoxToMediaBoxOffset</b></tt>
+distiller parameter is present.
+It accepts offsets to the <b><tt>MediaBox</b></tt> as an array
+[<i>left right top bottom</i>],
+e.g., the PostScript input code
+<b><tt><< /PDFXTrimBoxToMediaBoxOffset
+[10 20 30 40] >> setdistillerparams</b></tt>
+specifies that 10 points will be trimmed at the left,
+20 points at the right,
+30 points at the top,
+and 40 points at the bottom.
+
+<p>Another page entry is the <b><tt>BleedBox</b></tt>.
+It gives the area of the page
+to which actual output items may extend;
+cut marks, color bars etc.
+must be positioned in the area between the <b><tt>BleedBox</b></tt>
+and the <b><tt>MediaBox</b></tt>.
+The <b><tt>TrimBox</b></tt> is always contained within the
+<b><tt>BleedBox</b></tt>.
+By default,
+the <b><tt>PDFXSetBleedBoxToMediaBox</b></tt> distiller parameter
+is <b><tt>true</b></tt>,
+and the <b><tt>BleedBox</b></tt> is set to the same values
+as the <b><tt>MediaBox</b></tt>.
+If it is set to <b><tt>false</b></tt>,
+the <b><tt>PDFXBleedBoxToTrimBoxOffset</b></tt>
+parameter gives offset to the <b><tt>TrimBox</b></tt>.
+It accepts a four-value array in the same format as the
+<b><tt>PDFXTrimBoxToMediaBoxOffset</b></tt> parameter.
+
<p>
Here is a sample command line to invoke Ghostscript for generating a PDF/X-3 document :
Modified: trunk/gs/lib/gs_pdfwr.ps
===================================================================
--- trunk/gs/lib/gs_pdfwr.ps 2006-01-20 06:38:30 UTC (rev 6476)
+++ trunk/gs/lib/gs_pdfwr.ps 2006-01-20 06:43:12 UTC (rev 6477)
@@ -86,6 +86,9 @@
/Optimize true
/ParseDSCComments true
/ParseDSCCommentsForDocInfo true
+ /PDFXTrimBoxToMediaBoxOffset [0 0 0 0]
+ /PDFXSetBleedBoxToMediaBox true
+ /PDFXBleedBoxToTrimBoxOffset [0 0 0 0]
/PreserveCopyPage true
/PreserveHalftoneInfo false
/sRGBProfile (None) % (sRGB IEC61966-2.1)
@@ -613,6 +616,10 @@
/PreserveCopyPage { }
/UsePrologue { }
/OffOptimizations { }
+ % PDF/X parameters
+ /PDFXTrimBoxToMediaBoxOffset { }
+ /PDFXSetBleedBoxToMediaBox { }
+ /PDFXBleedBoxToTrimBoxOffset { }
% Color sampled image parameters
/ColorACSImageDict { }
/AntiAliasColorImages { }
More information about the gs-cvs
mailing list