正如标题所示,我需要一个(简单的 128)条形码,并且需要 PDF/A 标准。我知道如何分别完成这两项工作。但是 pdfx 无法与 latex 一起运行,因此我无法创建 DVI 等,而这正是 pst-barcode 包所需要的:
! pdfTeX error (\pdfmapline): not allowed in DVI mode (\pdfoutput <= 0). \pdfmapline
有没有办法在没有 pst-barcode 的情况下获得与 pdfLatex 兼容的条形码和 PDF/A?非常感谢!
编辑:使用下面答案中的代码会产生以下终端输出(略有截断):
C:\test\lat>xelatex --shell-escape -output-driver="xdvipdfmx -z 0" xeBar.tex
This is XeTeX, Version 3.14159265-2.6-0.999992 (MiKTeX 2.9.7380 64-bit)
entering extended mode
(xeBar.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
[...]
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\psdextra.
def")
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/colorprofiles\co
lorprofiles.sty"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/colorprofiles\co
lorprofiles.tex"))
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/stringenc\se-asc
ii-print.def")
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pdfx\AdobeColorPro
files.tex")
** pdfx: No file xeBar.xmpdata . Metadata will be incomplete!
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\ifthen.sty")
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/xmpincl\xmpincl.st
y")
Using XMP template file: pdfa.xmp
)
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pst-barcode\pst-ba
rcode.sty"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pstricks\pstricks.
sty"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/tools\shellesc.sty
")
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/xkeyval\pst-xkey
.tex"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/xkeyval\xkeyval.st
y"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/xkeyval\xkeyval.
tex"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/xkeyval\xkvutils
.tex"))))
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pstricks\pstrick
s.tex"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pstricks\pst-fp.
tex" `pst-fp' v0.05, 2010/01/17 (hv))
[...]
`PSTricks' v2.97 <2019/05/11> (tvz,hv)
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/xelatex/xetex-pstricks\p
stricks.con"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pstricks\xdvipdf
mx.cfg"))
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/xelatex/xetex-pstricks\p
stricks.con"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pstricks\xdvipdf
mx.cfg"
Using PSTricks configuration for XeTeX+xdvipdfmx
)))
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pstricks\pst-fp.
tex")
>>> Loading XeTeX special macros
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pstricks\pstrick
s-xetex.def"))
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pst-barcode\pst-
barcode.tex" `PST-barcode' v0.18, 2017/08/22 (tb,hv)
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/marginnote\marginn
ote.sty")))
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/l3backend\l3backen
d-xdvipdfmx.def") (xeBar.aux)
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\ts1cmr.fd")
ABD: EveryShipout initializing macros
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\nameref.s
ty"
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/latex/refcount\refcount.
sty")
("C:\Users\Dev06\AppData\Local\Programs\MiKTeX 2.9\tex/generic/gettitlestring\g
ettitlestring.sty")) (xeBar.out) (xeBar.out) [1] (xeBar.aux) )stdin -> stdout
[1
xdvipdfmx:warning: Could not find any valid object.
xdvipdfmx:warning: Filtering file via command -->mgs.exe -q -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoRotatePages=/None -sOutputFile="C:/Users/Dev06/AppData/Local/Temp/mikDCFC.tmp" "C:/Users/Dev06/AppData/Local/Temp/mikDCFB.tmp" -c quit<-- failed.
xdvipdfmx:warning: Image format conversion for PSTricks failed.
xdvipdfmx:warning: Interpreting special command pst: (ps:) failed.
xdvipdfmx:warning: >> at page="1" position="(148.712, 595.198)" (in PDF)
xdvipdfmx:warning: >> xxx "pst: tx@Dict begin STP newpath 0.8 SLW 0 0 0 setrgbcolor gs"
]
11723 bytes written
答案1
您可以将 PSTricks 软件包与 XeLaTeX 一起使用,它也受 支持pdfx
。根据文档(第 1 页的pdfx
脚注)您需要以下命令:
xelatex --shell-escape -output-driver="xdvipdfmx -z 0" <filename>.tex
梅威瑟:
\documentclass{article}
\usepackage[a-1b]{pdfx}
\usepackage{pst-barcode}
\begin{document}
\begin{pspicture}(2.5,1in)
\psbarcode{01335583}{includetext}{ean8}
\end{pspicture}
\end{document}
结果: