summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-12-05 01:52:40 +0000
committerKarl Berry <karl@freefriends.org>2008-12-05 01:52:40 +0000
commitd00f2929d26af30109b9c7f5909b584460b73978 (patch)
treee4ca1a17c574062225ca3f59ef5829b89792ad30 /Master/texmf-dist/tex/latex/pdfx/pdfx.sty
parent328f6344fc5d11b5731246b12ea1df785d55d968 (diff)
new latex package pdfx (4dec08)
git-svn-id: svn://tug.org/texlive/trunk@11521 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pdfx/pdfx.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pdfx/pdfx.sty201
1 files changed, 201 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pdfx/pdfx.sty b/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
new file mode 100644
index 00000000000..f10e9d98c93
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
@@ -0,0 +1,201 @@
+%%
+%% This is file `pdfx.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pdfx.dtx (with options: `package')
+%%
+%% Copyright (c) 2008, CV Radhakrishnan <cvr@river-valley.org>,
+%% Han The Thanh <thanh@river-valley.org>
+%%
+%% This file may be distributed and/or modified under the conditions
+%% of the LaTeX Project Public License, either version 1.2 of this
+%% license or (at your option) any later version. The latest version
+%% of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pdfx}
+ [2008/12/01 v1.1 PDF/X and PDF/A support (CVR/HTH)]
+
+\newif\ifpdfxonea \pdfxoneafalse
+\newif\ifpdfaoneb \pdfaonebfalse
+
+\DeclareOption{a-1b}{\global\pdfaonebtrue}
+\DeclareOption{x-1a}{\global\pdfxoneatrue}
+\ProcessOptions
+
+\ifpdfxonea
+ \pdfminorversion=3
+ \pdfpageattr{/MediaBox[0 0 595 793]
+ /BleedBox[0 0 595 793]
+ /TrimBox[25 20 570 773]}
+\else
+ \pdfminorversion=4
+\fi
+\def\hash{\expandafter\@gobble\string\#}
+\def\amp{\expandafter\@gobble\string\&}
+\def\xmpAmp{\amp\hash x0026;}
+\def\TextCopyright{\amp\hash x00A9;}
+\def\Title#1{\gdef\xmpTitle{#1}}
+ \let\xmpTitle\@empty
+\def\Author#1{\gdef\xmpAuthor{#1}}
+ \let\xmpAuthor\@empty
+\def\Keywords#1{\gdef\xmpKeywords{#1}}
+ \let\xmpKeywords\@empty
+ \let\xmpSubject\xmpKeywords
+\def\Creator#1{\gdef\xmpCreator{#1}}
+ \def\xmpCreator{\@pdfcreator}
+\def\Producer#1{\gdef\xmpProducer{#1}}
+ \def\xmpProducer{pdfTeX}
+\def\Volume#1{\gdef\xmpVolume{#1}}
+ \let\xmpVolume\@empty
+\def\Issue#1{\gdef\xmpIssue{#1}}
+ \let\xmpIssue\@empty
+\def\CoverDisplayDate#1{\gdef\xmpCoverDisplayDate{#1}}
+ \let\xmpCoverDisplayDate\@empty
+\def\CoverDate#1{\gdef\xmpCoverDate{#1}}
+ \let\xmpCoverDate\@empty
+\def\Copyright#1{\gdef\xmpCopyright{#1}}
+ \let\xmpCopyright\@empty
+\def\Doi#1{\gdef\xmpDoi{#1}}
+ \let\xmpDoi\@empty
+\def\Lastpage#1{\gdef\xmpLastpage{#1}}
+ \let\xmpLastpage\@empty
+\def\Firstpage#1{\gdef\xmpFirstpage{#1}}
+ \let\xmpFirstpage\@empty
+\def\Journaltitle#1{\gdef\xmpJournaltitle{#1}}
+ \let\xmpJournaltitle\@empty
+\def\Journalnumber#1{\gdef\xmpJournalnumber{#1}}
+ \let\xmpJournalnumber\@empty
+\def\Org#1{\gdef\xmpOrg{#1}}
+ \let\xmpOrg\@empty
+\def\CreatorTool#1{\gdef\xmpCreatorTool{#1}}
+ \def\xmpCreatorTool{\xmpProducer}
+\def\AuthoritativeDomain#1{\gdef\xmpAuthoritativeDomain{#1}}
+ \let\xmpAuthoritativeDomain\@empty
+\def\findUUID#1{\edef\tmpstring{\pdfmdfivesum{#1}}
+ \expandafter\eightofnine\tmpstring\end}
+\def\eightofnine#1#2#3#4#5#6#7#8#9\end{%
+ \xdef\eightchars{#1#2#3#4#5#6#7#8}
+ \fouroffive#9\end}
+\def\fouroffive#1#2#3#4#5\end{\xdef\ffourchars{#1#2#3#4}
+ \sfouroffive#5\end}
+\def\sfouroffive#1#2#3#4#5\end{\xdef\sfourchars{#1#2#3#4}
+ \tfouroffive#5\end}
+\def\tfouroffive#1#2#3#4#5\end{\xdef\tfourchars{#1#2#3#4}
+ \xdef\laststring{#5}}
+
+\def\uuid{\eightchars-%
+ \ffourchars-%
+ \sfourchars-%
+ \tfourchars-%
+ \laststring}
+
+\findUUID{\jobname.pdf}
+\edef\xmpdocid{\uuid}
+\findUUID{\pdfcreationdate}
+\edef\xmpinstid{\uuid}
+\InputIfFileExists{\jobname.xmpdata}{}{}
+\RequirePackage{xmpincl}
+\def\convertDate{\getYear}
+{\catcode`\D=12
+ \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}
+}
+\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}
+\def\getDay#1#2{\edef\xDay{#1#2}\getHour}
+\def\getHour#1#2{\edef\xHour{#1#2}\getMin}
+\def\getMin#1#2{\edef\xMin{#1#2}\getSec}
+\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}
+\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}
+\def\getTZm '#1#2'{%
+ \edef\xTZm{#1#2}%
+ \edef\convDate{\xYear-\xMonth-\xDay
+ T\xHour:\xMin:\xSec+\xTZh:\xTZm}}
+\expandafter\convertDate\pdfcreationdate
+\ifpdfxonea
+ \def\@pctchar{\expandafter\@gobble\string\%}
+ \def\@bchar{\expandafter\@gobble\string\\}
+ \immediate\pdfobj stream attr{/N 4} file{FOGRA39L.icc}
+ \edef\OBJ@CVR{\the\pdflastobj}
+ \pdfcatalog{/OutputIntents [ <<
+ /Type/OutputIntent
+ /S/GTS_PDFX
+ /OutputCondition (FOGRA39)
+ /OutputConditionIdentifier (FOGRA39 \@bchar(ISO Coated v2
+ 300\@pctchar\space \@bchar(ECI\@bchar)\@bchar))
+ /DestOutputProfile \OBJ@CVR\space 0 R
+ /RegistryName(http://www.color.org)
+ >> ]}
+\else
+ \immediate\pdfobj stream attr{/N 4} file{sRGBIEC1966-2.1.icm}
+ \edef\OBJ@RVT{\the\pdflastobj}
+ \pdfcatalog{%
+ /OutputIntents [ <<
+ /Type /OutputIntent
+ /S/GTS_PDFA1
+ /DestOutputProfile \OBJ@RVT\space 0 R
+ /OutputConditionIdentifier (sRGB IEC61966-2.1)
+ /Info(sRGB IEC61966-2.1)
+ >> ]}
+\fi
+\begingroup
+\let\&=\xmpAmp
+\ifpdfxonea
+ \includexmp{pdfx-1a}
+\else
+ \includexmp{pdfa-1b}
+\fi
+\endgroup
+
+\input glyphtounicode.tex
+\input glyphtounicode-cmr.tex
+\pdfgentounicode=1
+\ifpdfxonea
+ \RequirePackage[draft,pdftex,pdfpagemode=UseNone,bookmarks=false]{hyperref}
+ \pdfinfo{
+ /Title(\xmpTitle)%
+ /Author(\xmpAuthor)%
+ /Creator(\xmpProducer)%
+ /CreationDate(\convDate)%
+ /ModDate(\convDate)%
+ /Producer(\xmpProducer)%
+ /Trapped /False
+ /GTS_PDFXVersion (PDF/X-1:2001)%
+ /GTS_PDFXConformance (PDF/X-1a:2001)%
+ }
+\else
+ \RequirePackage[pdftex,pdfa]{hyperref}
+ \def\PDF@FinishDoc{%
+ \Hy@UseMaketitleInfos
+ \pdfinfo{%
+ /Creator(\xmpProducer)%
+ \ifx\@pdfcreationdate\@empty
+ \else
+ /CreationDate(\@pdfcreationdate)%
+ \fi
+ \ifx\@pdfmoddate\@empty
+ \else
+ /ModDate(\@pdfmoddate)%
+ \fi
+ /Producer(\xmpProducer)%
+ /Trapped /False
+ /GTS_PDFA1Version (PDF/A-1b:2005)%
+ }%
+ \Hy@DisableOption{pdfauthor}%
+ \Hy@DisableOption{pdftitle}%
+ \Hy@DisableOption{pdfsubject}%
+ \Hy@DisableOption{pdfcreator}%
+ \Hy@DisableOption{pdfcreationdate}%
+ \Hy@DisableOption{pdfmoddate}%
+ \Hy@DisableOption{pdfproducer}%
+ \Hy@DisableOption{pdfkeywords}}
+\fi
+\endinput
+%%
+%% End of file `pdfx.sty'.