Skip to content

Commit

Permalink
Actually use the profile, switched to PDF/X-1a from PDF/X-3
Browse files Browse the repository at this point in the history
  • Loading branch information
aginiewicz committed Jul 27, 2011
1 parent b47e8b5 commit 66de2ab
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 44 deletions.
63 changes: 27 additions & 36 deletions createspace.dtx
Expand Up @@ -43,7 +43,7 @@
%</driver>
% \fi
%
% \CheckSum{1698}
% \CheckSum{1730}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
Expand All @@ -64,6 +64,7 @@
%
% \changes{0.9}{2011/05/18}{First DTX version, WIP}
% \changes{0.91}{2011/07/27}{Adjusted page dimensions setup}
% \changes{0.92}{2011/07/27}{Switched to PDF/X-1a generation}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
Expand All @@ -84,9 +85,6 @@
% Put text here.
%
%
% \DescribeMacro{\calcln}
%
%
% \DescribeMacro{\author}
%
%
Expand All @@ -105,12 +103,6 @@
% \DescribeMacro{\pdfkeywords}
%
%
% \DescribeMacro{\profile}
%
%
% \DescribeMacro{\profile}
%
%
% \StopEventually{}
%
% \section{Implementation}
Expand All @@ -127,7 +119,7 @@
\define@choicekey*+{createspace.sty}{preview}[\val\nr]{false,a4,letter}[a4]{\let\createspace@preview\nr\let\createspace@previewname\val}{\PackageWarning{createspace}{unknown preview option}}
\define@choicekey*+{createspace.sty}{colourpackage}[\val\nr]{none,color,xcolor}{\let\createspace@colourpackage\nr\let\createspace@colourpackagename\val}{\PackageWarning{createspace}{unknown colourpackage option}}
\define@choicekey*+{createspace.sty}{colorpackage}[\val\nr]{none,color,xcolor}{\let\createspace@colorpackage\nr\let\createspace@colorpackagename\val}{\PackageWarning{createspace}{unknown colorpackage option}}
\define@boolkeys{createspace.sty}[createspace@]{bleed,colour,color,nopdf,nopage}[true]
\define@boolkeys{createspace.sty}[createspace@]{bleed,colour,color,nopdf,nopage,noicc}[true]
\define@cmdkeys{createspace.sty}[createspace@]{inner,outer,top,bottom,gutter,geometryextra,customsize}
\presetkeys{createspace.sty}{size=novel,trim=0,paper=white,preview=false,gutter=0.3in,inner=0.5in,outer=0.5in,top=0.5in,bottom=0.5in,geometryextra={twoside,heightrounded,truedimen},colourpackage=xcolor,colorpackage=xcolor}{}
\ProcessOptionsX
Expand Down Expand Up @@ -864,11 +856,11 @@
\fi
% \end{macrocode}
%
% \begin{macro}{\calcln}
% calcln[i]{n}{res} - calculates res = ln(n) using i iterations
% \begin{macro}{\cs@calcln}
% cs@calcln[i]{n}{res} - calculates res = ln(n) using i iterations
% (works for natural numbers n)
% \begin{macrocode}
\newcommand\calcln[3][65]{
\newcommand\cs@calcln[3][65]{
\ifx\log@digits\undefined\newcount\log@digits\fi
\log@digits=0
% \end{macrocode}
Expand Down Expand Up @@ -965,7 +957,7 @@
\ifnum\temp<6
\temp=6
\fi
\expandafter\calcln\expandafter{\the\temp}{createspace@res}
\expandafter\cs@calcln\expandafter{\the\temp}{createspace@res}
\newdimen\createspace@log \createspace@log=\createspace@res pt
\multiply\createspace@log by 3
\divide\createspace@log by 20
Expand Down Expand Up @@ -1231,44 +1223,43 @@
\ifx\@pdfauthor\@empty
\PackageError{createspace}{you must specify book author}{specify author using \protect\author\space or \protect\pdfauthor\space command}
\fi
\ifcreatespace@noicc
\pdfinfo{
/Title (\@pdftitle)
/Author (\@pdfauthor)
/Subject (\@pdfsubject)
/Keywords (\@pdfkeywords)
}%
\else
\pdfinfo{
/Title (\@pdftitle)
/Author (\@pdfauthor)
/Subject (\@pdfsubject)
/Keywords (\@pdfkeywords)
/GTS_PDFXVersion (PDF/X-3:2002)
/GTS_PDFXVersion (PDF/X-1:2001)
/GTS_PDFXConformance (PDF/X-1a:2001)
}%
\ifcase\createspace@paper\relax
% \end{macrocode}
%
% \begin{macro}{\profile}
% \begin{macrocode}
\xdef\profile{OFCOM_PO_P4_F60_04}%
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\immediate\pdfobj stream attr{/N 4} file{PSO_Uncoated_ISO12647_bas.ICC}%
\edef\cs@profile{\the\pdflastobj}%
\xdef\cs@profilename{PSO Uncoated ISO12647}%
\else
% \end{macrocode}
%
% \begin{macro}{\profile}
% \begin{macrocode}
\xdef\profile{OFCOM_PO_P5_F60_04}%
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\immediate\pdfobj stream attr{/N 4} file{ISOuncoatedyellowish_bas.ICC}%
\edef\cs@profile{\the\pdflastobj}%
\xdef\cs@profilename{ISO Uncoated Yellowish}%
\fi
\def\cs@backslash{\expandafter\@gobble\string\\}
\pdfcatalog{
/PageMode /UseNone
/OutputIntents [ <<
/Info (none)
/Type /OutputIntent
/S /GTS_PDFX
/OutputConditionIdentifier (\profile)
/OutputConditionIdentifier (\cs@profilename\space\cs@backslash(basICColor\cs@backslash))
/DestOutputProfile \cs@profile\space 0 R
/RegistryName (http://www.color.org/)
>> ]
}%
\fi
\newcount\cs@temp
\newdimen\cs@width\newdimen\cs@widthb
\cs@width=\dimexpr\createspace@l@width*800/803\relax
Expand Down
31 changes: 23 additions & 8 deletions createspace.sty
Expand Up @@ -28,7 +28,7 @@
\define@choicekey*+{createspace.sty}{preview}[\val\nr]{false,a4,letter}[a4]{\let\createspace@preview\nr\let\createspace@previewname\val}{\PackageWarning{createspace}{unknown preview option}}
\define@choicekey*+{createspace.sty}{colourpackage}[\val\nr]{none,color,xcolor}{\let\createspace@colourpackage\nr\let\createspace@colourpackagename\val}{\PackageWarning{createspace}{unknown colourpackage option}}
\define@choicekey*+{createspace.sty}{colorpackage}[\val\nr]{none,color,xcolor}{\let\createspace@colorpackage\nr\let\createspace@colorpackagename\val}{\PackageWarning{createspace}{unknown colorpackage option}}
\define@boolkeys{createspace.sty}[createspace@]{bleed,colour,color,nopdf,nopage}[true]
\define@boolkeys{createspace.sty}[createspace@]{bleed,colour,color,nopdf,nopage,noicc}[true]
\define@cmdkeys{createspace.sty}[createspace@]{inner,outer,top,bottom,gutter,geometryextra,customsize}
\presetkeys{createspace.sty}{size=novel,trim=0,paper=white,preview=false,gutter=0.3in,inner=0.5in,outer=0.5in,top=0.5in,bottom=0.5in,geometryextra={twoside,heightrounded,truedimen},colourpackage=xcolor,colorpackage=xcolor}{}
\ProcessOptionsX
Expand Down Expand Up @@ -598,7 +598,7 @@
\crop[\createspace@croptype]
\fi
\fi
\newcommand\calcln[3][65]{
\newcommand\cs@calcln[3][65]{
\ifx\log@digits\undefined\newcount\log@digits\fi
\log@digits=0
\def\log@count##1##2\log@tillthis{\advance\log@digits by 1\xdef\log@rest{##2}\ifx\log@rest\@empty\else\log@count ##2\log@tillthis\fi}
Expand Down Expand Up @@ -647,7 +647,7 @@
\ifnum\temp<6
\temp=6
\fi
\expandafter\calcln\expandafter{\the\temp}{createspace@res}
\expandafter\cs@calcln\expandafter{\the\temp}{createspace@res}
\newdimen\createspace@log \createspace@log=\createspace@res pt
\multiply\createspace@log by 3
\divide\createspace@log by 20
Expand Down Expand Up @@ -813,28 +813,43 @@
\ifx\@pdfauthor\@empty
\PackageError{createspace}{you must specify book author}{specify author using \protect\author\space or \protect\pdfauthor\space command}
\fi
\ifcreatespace@noicc
\pdfinfo{
/Title (\@pdftitle)
/Author (\@pdfauthor)
/Subject (\@pdfsubject)
/Keywords (\@pdfkeywords)
/GTS_PDFXVersion (PDF/X-3:2002)
}%
\else
\pdfinfo{
/Title (\@pdftitle)
/Author (\@pdfauthor)
/Subject (\@pdfsubject)
/Keywords (\@pdfkeywords)
/GTS_PDFXVersion (PDF/X-1:2001)
/GTS_PDFXConformance (PDF/X-1a:2001)
}%
\ifcase\createspace@paper\relax
\xdef\profile{OFCOM_PO_P4_F60_04}%
\immediate\pdfobj stream attr{/N 4} file{PSO_Uncoated_ISO12647_bas.ICC}%
\edef\cs@profile{\the\pdflastobj}%
\xdef\cs@profilename{PSO Uncoated ISO12647}%
\else
\xdef\profile{OFCOM_PO_P5_F60_04}%
\immediate\pdfobj stream attr{/N 4} file{ISOuncoatedyellowish_bas.ICC}%
\edef\cs@profile{\the\pdflastobj}%
\xdef\cs@profilename{ISO Uncoated Yellowish}%
\fi
\def\cs@backslash{\expandafter\@gobble\string\\}
\pdfcatalog{
/PageMode /UseNone
/OutputIntents [ <<
/Info (none)
/Type /OutputIntent
/S /GTS_PDFX
/OutputConditionIdentifier (\profile)
/OutputConditionIdentifier (\cs@profilename\space\cs@backslash(basICColor\cs@backslash))
/DestOutputProfile \cs@profile\space 0 R
/RegistryName (http://www.color.org/)
>> ]
}%
\fi
\newcount\cs@temp
\newdimen\cs@width\newdimen\cs@widthb
\cs@width=\dimexpr\createspace@l@width*800/803\relax
Expand Down

0 comments on commit 66de2ab

Please sign in to comment.