# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= texlive-bin VERSION= 20240312 KEYWORDS= print VARIANTS= standard SDESC[standard]= Binary and input files for TeXlive HOMEPAGE= https://www.tug.org/texlive CONTACT= Michael_Reim[kraileth@elderlinux.org] DOWNLOAD_GROUPS= main copying lppl SITES[main]= ftp://ftp.tug.org/texlive/historic/2024/ SITES[copying]= https://www.tug.org/texlive/ SITES[lppl]= https://www.latex-project.org/ DISTFILE[1]= texlive-20240312-source.tar.xz:main DISTFILE[2]= texlive-20240312-extra.tar.xz:main DISTFILE[3]= LICENSE.TL:copying DISTFILE[4]= lppl.txt:lppl DIST_SUBDIR= texlive DF_INDEX= 1 2 3 4 SPKGS[standard]= complete primary docs bibtex engine_hitex engine_luatex engine_pdftex engine_xetex synctex tlmgr utils xindy OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none BUILD_DEPENDS= gmp:static:standard mpfr:static:standard clisp:primary:standard harfbuzz:dev:standard icu:dev:standard libpaper:dev:standard poppler:dev:standard graphite:dev:standard zziplib:dev:standard BUILDRUN_DEPENDS= gmp:shared:standard graphite:primary:standard harfbuzz:icu:standard icu:primary:standard libGD:single:standard libpaper:primary:standard mpfr:shared:standard poppler:primary:standard potrace:library:standard zziplib:primary:standard RUN_DEPENDS= libffcall:single:standard libsigsegv:shared:standard texlive-texmf:primary:standard EXRUN[engine_hitex]= primary EXRUN[engine_pdftex]= primary EXRUN[synctex]= primary EXRUN[primary]= tlmgr EXRUN[utils]= primary EXRUN[engine_xetex]= icu:data:standard primary EXRUN[bibtex]= primary EXRUN[engine_luatex]= primary USES= cpe freetype gmake libtool ncurses perl png readline shebangfix zlib mbsdfix GNOME_COMPONENTS= cairo XORG_COMPONENTS= pixman x11 xaw DISTNAME= texlive-20240312-source EXTRACT_ONLY= 1 2 LICENSE= CUSTOM1:primary LICENSE_TERMS= primary:{{DISTDIR}}/{{DIST_SUBDIR}}/LICENSE.TL LICENSE_NAME= CUSTOM1:"TeX Live - Multi-license (LPPL, GNU, BSD, etc)" LICENSE_FILE= CUSTOM1:{{DISTDIR}}/{{DIST_SUBDIR}}/lppl.txt LICENSE_SCHEME= solo CPE_PRODUCT= texlive CPE_VENDOR= tug FPC_EQUIVALENT= print/texlive-base SHEBANG_FILES= texk/texlive/linked_scripts/accfonts/mkt1font texk/texlive/linked_scripts/accfonts/vpl2ovp texk/texlive/linked_scripts/accfonts/vpl2vpl texk/texlive/linked_scripts/arara/arara.sh texk/texlive/linked_scripts/bibcop/bibcop.pl texk/texlive/linked_scripts/bibexport/bibexport.sh texk/texlive/linked_scripts/clojure-pamphlet/pamphletangler texk/texlive/linked_scripts/ctan-o-mat/ctan-o-mat.pl texk/texlive/linked_scripts/ctanupload/ctanupload.pl texk/texlive/linked_scripts/de-macro/de-macro texk/texlive/linked_scripts/dtxgen/dtxgen texk/texlive/linked_scripts/ebong/ebong.py texk/texlive/linked_scripts/eolang/eolang.pl texk/texlive/linked_scripts/exceltex/exceltex texk/texlive/linked_scripts/findhyph/findhyph texk/texlive/linked_scripts/fragmaster/fragmaster.pl texk/texlive/linked_scripts/git-latexdiff/git-latexdiff texk/texlive/linked_scripts/installfont/installfont-tl texk/texlive/linked_scripts/latex-papersize/latex-papersize.py texk/texlive/linked_scripts/latexpand/latexpand texk/texlive/linked_scripts/lilyglyphs/lily-glyph-commands.py texk/texlive/linked_scripts/lilyglyphs/lily-image-commands.py texk/texlive/linked_scripts/lilyglyphs/lily-rebuild-pdfs.py texk/texlive/linked_scripts/ltxfileinfo/ltxfileinfo texk/texlive/linked_scripts/makedtx/makedtx.pl texk/texlive/linked_scripts/mathspic/mathspic.pl texk/texlive/linked_scripts/memoize/memoize-clean.py texk/texlive/linked_scripts/mf2pt1/mf2pt1.pl texk/texlive/linked_scripts/multibibliography/multibibliography.pl texk/texlive/linked_scripts/pdfbook2/pdfbook2 texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl texk/texlive/linked_scripts/pdftex-quiet/pdftex-quiet texk/texlive/linked_scripts/pdfxup/pdfxup texk/texlive/linked_scripts/petri-nets/pn2pdf texk/texlive/linked_scripts/pythontex/depythontex.py texk/texlive/linked_scripts/pythontex/pythontex.py texk/texlive/linked_scripts/splitindex/splitindex.pl texk/texlive/linked_scripts/svn-multi/svn-multi.pl texk/texlive/linked_scripts/texliveonfly/texliveonfly.py texk/texlive/linked_scripts/tlcockpit/tlcockpit.sh texk/texlive/linked_scripts/ulqda/ulqda.pl texk/texlive/linked_scripts/urlbst/urlbst texk/texlive/linked_scripts/yplan/yplan MUST_CONFIGURE= gnu CONFIGURE_OUTSOURCE= yes CONFIGURE_ARGS= --with-banner-add="/Ravenports" -C --disable-dump-share --disable-multiplatform --disable-native-texlive-build --disable-static --disable-xindy-rules --enable-luatex --enable-shared --enable-xindy --enable-xindy-docs --with-clisp-runtime=default --with-system-cairo --with-system-freetype2 --with-system-gd --with-system-gmp --with-system-graphite --with-system-harfbuzz --with-system-icu --with-system-libpaper --with-system-mpfr --with-system-ncurses --with-system-pixman --with-system-pnglib --with-system-poppler --with-system-potrace --with-system-t1lib --with-system-zlib --with-system-zziplib --with-xdvi-x-toolkit=xaw INSTALL_REQ_TOOLCHAIN= yes PLIST_SUB= LIBKPATHSEA=6.4.0 LIBKPATHSEA_MAJOR=6 LIBPTEXENC=1.4.6 LIBPTEXENC_MAJOR=1 LIBSYNCTEX=2.0.0 LIBSYNCTEX_MAJOR=2 LIBTEXLUA53=5.3.6 LIBTEXLUA53_MAJOR=5 LIBTEXLUAJIT=2.1.0 LIBTEXLUAJIT_MAJOR=2 SUB_FILES= pkg-message-primary post-patch: ${CP} ${FILESDIR}/pdftoepdf-poppler0.76.0.cc \ ${WRKSRC}/texk/web2c/pdftexdir/ ${CP} ${FILESDIR}/pdftosrc-poppler0.76.0.cc \ ${WRKSRC}/texk/web2c/pdftexdir/ post-install: ${MKDIR} -p ${STAGEDIR}${PREFIX}/lib/perl5/site_perl ${CP} -r ${WRKDIR}/texlive-20240312-extra/tlpkg/TeXLive ${STAGEDIR}${SITE_PERL} ${RM} -r ${STAGEDIR}${PREFIX}/share/info ${LN} -s eptex ${STAGEDIR}${PREFIX}/bin/platex ${LN} -s euptex ${STAGEDIR}${PREFIX}/bin/uplatex ${LN} -s luahbtex ${STAGEDIR}${PREFIX}/bin/dvilualatex ${LN} -s luahbtex ${STAGEDIR}${PREFIX}/bin/dviluatex ${LN} -s luahbtex ${STAGEDIR}${PREFIX}/bin/lualatex ${LN} -s tex ${STAGEDIR}${PREFIX}/bin/lollipop ${LN} -s xetex ${STAGEDIR}${PREFIX}/bin/xelatex for lx in ${PDFTEX_LINKS}; do \ ${LN} -s pdftex ${STAGEDIR}${PREFIX}/bin/$$lx ;\ done for x in kpathsea ptexenc synctex texlua53 texluajit; do \ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib$$x.so ;\ done for p in ${PROGRAMS0} ${PROGRAMS1} ${PROGRAMS2}; do \ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/$$p ;\ done [FILE:254:descriptions/desc.primary] TeXLive is a complete distribution of the TeX typesetting system and all the common components used together with it. This package installs most of the core programs except for the advanced engines, as well as some extensions and additional programs. [FILE:78:descriptions/desc.docs] This sub-package contains the documentation for all of the TeXlive programs. [FILE:267:descriptions/desc.bibtex] This sub-package contains the BibTeX extension. BibTeX is a reference management software for formatting lists of references. BibTeX is meant to make it easy to cite sources in a consistent manner, by separating bibliographic information from its representation. [FILE:279:descriptions/desc.engine_hitex] This sub-package contains the HiTeX engine. HiTeX brings reflowing output to the TeX world via the HINT file format. It is meant to produce great output for use with various mobile devices where the screen size is not known at the time the document is first being layed out. [FILE:371:descriptions/desc.engine_luatex] This sub-package contains the LuaTeX engine. LuaTex is an extended version of pdfTeX that uses Lua as an embedded scripting language. Like XeTeX it supports Unicode and modern fonts but is is extremely flexible due to being scriptable. It is meant as the successor of Omega/Aleph (from which it inherited some features like multi-directional typesetting) and pdfTeX. [FILE:170:descriptions/desc.engine_pdftex] This sub-package contains the pdfTeX engine. The pdfTeX engine allows to render TeX sources directly to PDF files whereas the original engine only supports DVI output. [FILE:246:descriptions/desc.engine_xetex] This sub-package contains the XeTeX engine. XeTeX features native support for Unicode and modern font formats. It allows for advanced typographic features like glyphs, ligatures and variable font weights. Microtypography is supported as well. [FILE:270:descriptions/desc.synctex] This sub-package contains SyncTeX. SyncTeX is a utility that allows for synchronization between the source files and the document output. It enables various TeX editors to jump right to the position in e.g. the generated PDF file that the cursor was in your source. [FILE:113:descriptions/desc.tlmgr] This sub-package contains the tlmgr utility as well as several perl modules used by the TL core infrastructure. [FILE:104:descriptions/desc.utils] This sub-package contains various programs useful when working with but not directly depending on TeX. [FILE:333:descriptions/desc.xindy] This sub-package contains the Xindy package. Xindy is a flexible program for sorting and formatting book indexes. It was written as a successor of TeX's Makeindex program. In contrast to the latter it features good support for many languages in addition to English as well as many standard character encodings including Unicode. [FILE:425:distinfo] 7b6d87cf01661670fac45c93126bed97b9843139ed510f975d047ea938b6fe96 70140588 texlive/texlive-20240312-source.tar.xz 770f1946cdcd1b5ddada2ea328bb37294174f70a2be28b33f38ce14717bc5496 1990624 texlive/texlive-20240312-extra.tar.xz e8f070b2d1a9bad00af9d6cb94e687f2120591d092c8dab8727249b70adc96d0 5267 texlive/LICENSE.TL 3d262cdf34dafa6955f703c634a8c238ec44109bc8dd6ef34fb7aa54809f7e66 19102 texlive/lppl.txt [FILE:13184:manifests/plist.primary] bin/ a2ping a5toa4 adhocfilelist afm2afm afm2pl afm2tfm albatross aleph allcm allec allneeded arara arlatex authorindex autoinst bg5conv bibcop bundledoc cachepic cef5conv cefconv cefsconv cfftot1 checkcites checklistings chkdvifont chklref chktex chkweb citeproc-lua cjk-gs-integrate cluttex convbkmk ctan-o-mat ctangle ctanify ctanupload ctie ctwill ctwill-proofsort ctwill-refsort ctwill-twinx cweave de-macro depythontex detex deweb diadia digestif disdvi dosepsbin dt2dv dtxgen dv2dt dvi2fax dvi2tty dviasm dvibook dviconcat dvicopy dvidvi dvigif dvihp dviinfox dvilj dvilj2p dvilj4 dvilj4l dvilj6 dvipng dvipos dvips dvired dviselect dvispc dvisvgm dvitodvi dvitomp dvitype e2pall ebb ebong edtx2dtx eolang epsffit eptex euptex exceltex extconv extractbb extractres findhyph fmtutil fmtutil-sys fmtutil-user fontinst fragmaster getmapdl gftodvi gftopk gftype gregorio gsftopk hbf2gf ht htmex httex httexi hyperxmp-add-bytecount includeres inimf initex installfont-tl jamo-normalize jfmutil kanji-config-updmap kanji-config-updmap-sys kanji-config-updmap-user kanji-fontmap-creator ketcindy komkindex kpseaccess kpsepath kpsereadlink kpsestat kpsetool kpsewhere kpsewhich kpsexpand l3build lily-glyph-commands lily-image-commands lily-rebuild-pdfs listings-ext.sh lollipop ltx2crossrefxml ltx2unitxt ltxfileinfo ltximg luahbtex luajithbtex lwarpmk m-tx mag make4ht makedtx makeglossaries makeglossaries-lite makeindex makejvf match_parens mathspic memoize-clean memoize-extract mendex mf mf-nowin mf2pt1 mfplain mft mk4ht mkgrkindex mkindex mkjobtexmf mkocp mkofm mkpic mkt1font mktexfmt mktexlsr mktexmf mktexpk mktextfm mmafm mmpfb mpost msxlint musixflx musixtex odvicopy odvitype ofm2opl omfonts opl2ofm optexcount ot2kpx otangle otfinfo otftotfm otp2ocp outocp ovf2ovp ovp2ovf pagelayoutapi pamphletangler patgen pdvitomp pdvitype pedigree perltex pfarrei pfb2pfa pk2bm pkfix pkfix-helper pktogf pktype pltotf pmpost pmxchords pooltype ppltotf ps2frag ps2pk psbook psjoin psnup psresize psselect pstops ptekf ptex ptftopl purifyeps pygmentex pythontex r-mpost r-pmpost r-upmpost rubikrotation rumakeindex rungs runtexshebang sjisconv spix splitindex srcredact sty2dtx svn-multi t1dotlessj t1lint t1rawafm t1reencode t1testpage t4ht tangle teckit_compile tex tex4ebook tex4ht texaccents texblend texconfig texconfig-dialog texconfig-sys texcount texdef texdiff texdirflatten texdoc texfindpkg texfot texhash texlinks texliveonfly texloganalyser texlogfilter texlogsieve texosquery texosquery-jre5 texosquery-jre8 texplate textestvis tftopl tie tikztosvg tlcockpit tlshell ttf2afm ttf2kotexfont ttf2pk ttf2tfm ttfdump ttftotype42 twill twill-refsort typeoutfileinfo ulqda updmap updmap-sys updmap-user updvitomp updvitype upmendex upmpost uppltotf uptex uptftopl urlbst vftovp vpe vpl2ovp vpl2vpl vptovf weave webquiz wofm2opl wopl2ofm wordcount wovf2ovp wovp2ovf xdvi xdvi-xaw xindex xml2pmx yplan include/kpathsea/ absolute.h c-auto.h c-ctype.h c-dir.h c-errno.h c-fopen.h c-limits.h c-memstr.h c-minmax.h c-namemx.h c-pathch.h c-pathmx.h c-proto.h c-stat.h c-std.h c-unistd.h cnf.h concatn.h config.h debug.h expand.h getopt.h hash.h knj.h kpathsea.h lib.h line.h magstep.h mingw32.h paths.h pathsearch.h proginit.h progname.h readable.h simpletypes.h str-list.h str-llist.h systypes.h tex-file.h tex-glyph.h tex-hush.h tex-make.h types.h variable.h version.h win32lib.h include/ptexenc/ ptexenc.h unicode.h lib/ libkpathsea.so libkpathsea.so.%%LIBKPATHSEA%% libkpathsea.so.%%LIBKPATHSEA_MAJOR%% libptexenc.so libptexenc.so.%%LIBPTEXENC%% libptexenc.so.%%LIBPTEXENC_MAJOR%% lib/pkgconfig/ kpathsea.pc ptexenc.pc share/applications/xdvi.desktop share/man/man1/ afm2pl.1.gz afm2tfm.1.gz aleph.1.gz allcm.1.gz allec.1.gz allneeded.1.gz amstex.1.gz bg5conv.1.gz cef5conv.1.gz cefconv.1.gz cefsconv.1.gz cfftot1.1.gz chkdvifont.1.gz chktex.1.gz chkweb.1.gz ctangle.1.gz ctie.1.gz ctwill-proofsort.1.gz ctwill-refsort.1.gz ctwill-twinx.1.gz ctwill.1.gz cweave.1.gz cweb.1.gz detex.1.gz deweb.1.gz disdvi.1.gz dt2dv.1.gz dv2dt.1.gz dvi2fax.1.gz dvi2tty.1.gz dvibook.1.gz dviconcat.1.gz dvicopy.1.gz dvidvi.1.gz dvigif.1.gz dvihp.1.gz dvilj.1.gz dvilj2p.1.gz dvilj4.1.gz dvilj4l.1.gz dvilj6.1.gz dvilualatex-dev.1.gz dviluatex.1.gz dvipng.1.gz dvipos.1.gz dvips.1.gz dvired.1.gz dviselect.1.gz dvispc.1.gz dvisvgm.1.gz dvitodvi.1.gz dvitomp.1.gz dvitype.1.gz e2pall.1.gz ebb.1.gz epsffit.1.gz extconv.1.gz extractbb.1.gz extractres.1.gz fmtutil-sys.1.gz fmtutil.1.gz fontinst.1.gz gftodvi.1.gz gftopk.1.gz gftype.1.gz gsftopk.1.gz hbf2gf.1.gz includeres.1.gz inimf.1.gz initex.1.gz kpseaccess.1.gz kpsepath.1.gz kpsereadlink.1.gz kpsestat.1.gz kpsetool.1.gz kpsewhere.1.gz kpsewhich.1.gz kpsexpand.1.gz latex-dev.1.gz luahbtex.1.gz luajittex.1.gz lualatex-dev.1.gz mag.1.gz makeindex.1.gz makejvf.1.gz mendex.1.gz mf-nowin.1.gz mf.1.gz mft.1.gz mkindex.1.gz mkocp.1.gz mkofm.1.gz mktexfmt.1.gz mktexlsr.1.gz mktexmf.1.gz mktexpk.1.gz mktextfm.1.gz mmafm.1.gz mmpfb.1.gz mpost.1.gz msxlint.1.gz odvicopy.1.gz odvitype.1.gz ofm2opl.1.gz opl2ofm.1.gz otangle.1.gz otfinfo.1.gz otftotfm.1.gz otp2ocp.1.gz outocp.1.gz ovf2ovp.1.gz ovp2ovf.1.gz patgen.1.gz pdflatex-dev.1.gz pfb2pfa.1.gz pk2bm.1.gz pktogf.1.gz pktype.1.gz platex-dev.1.gz pltotf.1.gz pooltype.1.gz ps2frag.1.gz ps2pk.1.gz psbook.1.gz psjoin.1.gz psnup.1.gz psresize.1.gz psselect.1.gz pstops.1.gz psutils.1.gz ptekf.1.gz rumakeindex.1.gz sjisconv.1.gz t1dotlessj.1.gz t1lint.1.gz t1rawafm.1.gz t1reencode.1.gz t1testpage.1.gz tangle.1.gz tex.1.gz texconfig-sys.1.gz texconfig.1.gz texhash.1.gz texlinks.1.gz tftopl.1.gz tie.1.gz ttf2afm.1.gz ttf2pk.1.gz ttf2tfm.1.gz ttfdump.1.gz ttftotype42.1.gz twill-refsort.1.gz twill.1.gz updmap-sys.1.gz updmap.1.gz uplatex-dev.1.gz vftovp.1.gz vptovf.1.gz weave.1.gz xdvi.1.gz xelatex-dev.1.gz xml2pmx.1.gz share/man/man5/ fmtutil.cnf.5.gz updmap.cfg.5.gz share/texmf-dist/chktex/chktexrc share/texmf-dist/dvipdfmx/dvipdfmx.cfg share/texmf-dist/dvips/base/ color.pro crop.pro finclude.pro hps.pro special.pro tex.pro texc.pro texps.pro share/texmf-dist/dvips/gsftopk/render.ps share/texmf-dist/dvips/xdvi/config.xdvi share/texmf-dist/fonts/cmap/dvipdfmx/EUC-UCS2 share/texmf-dist/fonts/enc/dvips/base/ 7t.enc dvips-all.enc share/texmf-dist/fonts/enc/ttf2pk/base/T1-WGL4.enc share/texmf-dist/fonts/map/dvipdfmx/cid-x.map share/texmf-dist/fonts/map/glyphlist/ glyphlist.txt pdfglyphlist.txt texglyphlist.txt share/texmf-dist/fonts/sfd/ttf2pk/ Big5.sfd EUC.sfd HKSCS.sfd KS-HLaTeX.sfd SJIS.sfd UBg5plus.sfd UBig5.sfd UGB.sfd UGBK.sfd UJIS.sfd UKS-HLaTeX.sfd UKS.sfd Unicode.sfd share/texmf-dist/hbf2gf/ b5ka12.cfg b5kr12.cfg b5so12.cfg c1so12.cfg c2so12.cfg c3so12.cfg c4so12.cfg c5so12.cfg c6so12.cfg c7so12.cfg csso12.cfg gsfs14.cfg j2so12.cfg jsso12.cfg ksso17.cfg share/texmf-dist/psutils/paper.cfg share/texmf-dist/scripts/a2ping/a2ping.pl share/texmf-dist/scripts/accfonts/ mkt1font vpl2ovp vpl2vpl share/texmf-dist/scripts/adhocfilelist/adhocfilelist.sh share/texmf-dist/scripts/albatross/albatross.sh share/texmf-dist/scripts/arara/arara.sh share/texmf-dist/scripts/attachfile2/pdfatfi.pl share/texmf-dist/scripts/authorindex/authorindex share/texmf-dist/scripts/bibcop/bibcop.pl share/texmf-dist/scripts/bibtexperllibs/ltx2unitxt share/texmf-dist/scripts/bundledoc/ arlatex bundledoc share/texmf-dist/scripts/cachepic/cachepic.tlu share/texmf-dist/scripts/checklistings/checklistings.sh share/texmf-dist/scripts/chklref/chklref.pl share/texmf-dist/scripts/chktex/ chkweb.sh deweb.pl share/texmf-dist/scripts/citation-style-language/citeproc-lua.lua share/texmf-dist/scripts/cjk-gs-integrate/cjk-gs-integrate.pl share/texmf-dist/scripts/clojure-pamphlet/pamphletangler share/texmf-dist/scripts/context/perl/mptopdf.pl share/texmf-dist/scripts/convbkmk/convbkmk.rb share/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl share/texmf-dist/scripts/ctan-o-mat/ctan-o-mat.pl share/texmf-dist/scripts/ctanify/ctanify share/texmf-dist/scripts/ctanupload/ctanupload.pl share/texmf-dist/scripts/de-macro/de-macro share/texmf-dist/scripts/digestif/digestif.texlua share/texmf-dist/scripts/dosepsbin/dosepsbin.pl share/texmf-dist/scripts/dtxgen/dtxgen share/texmf-dist/scripts/dviasm/dviasm.py share/texmf-dist/scripts/dviinfox/dviinfox.pl share/texmf-dist/scripts/easydtx/edtx2dtx.pl share/texmf-dist/scripts/ebong/ebong.py share/texmf-dist/scripts/eolang/eolang.pl share/texmf-dist/scripts/exceltex/exceltex share/texmf-dist/scripts/findhyph/findhyph share/texmf-dist/scripts/fontools/ afm2afm autoinst ot2kpx share/texmf-dist/scripts/fragmaster/fragmaster.pl share/texmf-dist/scripts/glossaries/makeglossaries share/texmf-dist/scripts/hyperxmp/hyperxmp-add-bytecount.pl share/texmf-dist/scripts/installfont/installfont-tl share/texmf-dist/scripts/jfmutil/jfmutil.pl share/texmf-dist/scripts/ketcindy/ketcindy.pl share/texmf-dist/scripts/kotex-utils/ jamo-normalize.pl komkindex.pl ttf2kotexfont.pl share/texmf-dist/scripts/lilyglyphs/ lily-glyph-commands.py lily-image-commands.py lily-rebuild-pdfs.py share/texmf-dist/scripts/listings-ext/listings-ext.sh share/texmf-dist/scripts/ltxfileinfo/ltxfileinfo share/texmf-dist/scripts/ltximg/ltximg.pl share/texmf-dist/scripts/luafindfont/luafindfont.lua share/texmf-dist/scripts/make4ht/make4ht share/texmf-dist/scripts/makedtx/makedtx.pl share/texmf-dist/scripts/match_parens/match_parens share/texmf-dist/scripts/mathspic/mathspic.pl share/texmf-dist/scripts/memoize/ memoize-clean.pl memoize-clean.py memoize-extract.pl memoize-extract.py share/texmf-dist/scripts/mf2pt1/mf2pt1.pl share/texmf-dist/scripts/mkgrkindex/mkgrkindex share/texmf-dist/scripts/mkjobtexmf/mkjobtexmf.pl share/texmf-dist/scripts/mkpic/mkpic share/texmf-dist/scripts/optexcount/optexcount share/texmf-dist/scripts/pagelayout/ pagelayoutapi textestvis share/texmf-dist/scripts/pedigree-perl/pedigree.pl share/texmf-dist/scripts/perltex/perltex.pl share/texmf-dist/scripts/pfarrei/ a5toa4.tlu pfarrei.tlu share/texmf-dist/scripts/pkfix/pkfix.pl share/texmf-dist/scripts/pkfix-helper/pkfix-helper share/texmf-dist/scripts/psutils/ extractres.pl includeres.pl psjoin.pl share/texmf-dist/scripts/ptex-fontmaps/ kanji-config-updmap-sys.sh kanji-config-updmap-user.sh kanji-config-updmap.pl kanji-fontmap-creator.pl share/texmf-dist/scripts/purifyeps/purifyeps share/texmf-dist/scripts/pygmentex/pygmentex.py share/texmf-dist/scripts/pythontex/ depythontex.py pythontex.py share/texmf-dist/scripts/rubik/rubikrotation.pl share/texmf-dist/scripts/runtexshebang/runtexshebang.lua share/texmf-dist/scripts/spix/spix.py share/texmf-dist/scripts/splitindex/splitindex.pl share/texmf-dist/scripts/srcredact/srcredact.pl share/texmf-dist/scripts/sty2dtx/sty2dtx.pl share/texmf-dist/scripts/svn-multi/svn-multi.pl share/texmf-dist/scripts/tex4ebook/tex4ebook share/texmf-dist/scripts/tex4ht/ ht.sh htmex.sh httex.sh httexi.sh mk4ht.pl share/texmf-dist/scripts/texaccents/texaccents.sno share/texmf-dist/scripts/texblend/texblend share/texmf-dist/scripts/texcount/texcount.pl share/texmf-dist/scripts/texdef/texdef.pl share/texmf-dist/scripts/texdiff/texdiff share/texmf-dist/scripts/texdirflatten/texdirflatten share/texmf-dist/scripts/texdoc/texdoc.tlu share/texmf-dist/scripts/texfindpkg/texfindpkg.lua share/texmf-dist/scripts/texfot/texfot.pl share/texmf-dist/scripts/texlive/ fmtutil-sys.sh fmtutil-user.sh fmtutil.pl mktexlsr mktexmf mktexpk mktextfm rungs.lua updmap-sys.sh updmap-user.sh updmap.pl share/texmf-dist/scripts/texlive-extra/ xelatex-unsafe.sh xetex-unsafe.sh share/texmf-dist/scripts/texliveonfly/texliveonfly.py share/texmf-dist/scripts/texloganalyser/texloganalyser share/texmf-dist/scripts/texlogfilter/texlogfilter share/texmf-dist/scripts/texlogsieve/texlogsieve share/texmf-dist/scripts/texosquery/ texosquery-jre5.sh texosquery-jre8.sh texosquery.sh share/texmf-dist/scripts/texplate/texplate.sh share/texmf-dist/scripts/tikztosvg/tikztosvg share/texmf-dist/scripts/tlcockpit/tlcockpit.sh share/texmf-dist/scripts/tlshell/tlshell.tcl share/texmf-dist/scripts/typeoutfileinfo/typeoutfileinfo.sh share/texmf-dist/scripts/ulqda/ulqda.pl share/texmf-dist/scripts/urlbst/urlbst share/texmf-dist/scripts/vpe/vpe.pl share/texmf-dist/scripts/webquiz/webquiz.py share/texmf-dist/scripts/wordcount/wordcount.sh share/texmf-dist/scripts/yplan/yplan share/texmf-dist/source/fonts/zhmetrics/ttfonts.map share/texmf-dist/texconfig/ tcfmgr tcfmgr.map share/texmf-dist/ttf2pk/ VPS.rpl ttf2pk.cfg share/texmf-dist/web2c/ fmtutil.cnf texmf.cnf share/texmf-dist/xdvi/XDvi share/texmf-dist/xdvi/pixmap/ toolbar.xpm toolbar2.xpm [FILE:816:manifests/plist.docs] share/texmf-dist/doc/bibtex8/ 00bibtex8-history.txt 00bibtex8-readme.txt csfile.txt file_id.diz share/texmf-dist/doc/bibtexu/README share/texmf-dist/doc/bibtexu/examples/ test.bbl test.bib test.pdf test.tex share/texmf-dist/doc/chktex/ChkTeX.pdf share/texmf-dist/doc/xindy/ README dataflow.gif faq-1.html faq-2.html faq-3.html faq-4.html faq.html index.gif makeindex4.pdf manual-1.html manual-2.html manual-3.html manual-4.html manual-5.html manual-6.html manual-7.html manual.html mappings.gif next.gif prev.gif style-tutorial-1.html style-tutorial-2.html style-tutorial-3.html style-tutorial-4.html style-tutorial.html tex2xindy.pdf texindy.pdf toc.gif xindy.pdf share/texmf-dist/doc/xindy/style-tutorial/ ex1.raw ex1.tex ex2.raw ex2.tex index.tex style1.xdy style2.xdy [FILE:765:manifests/plist.bibtex] bin/ bbl2bib bib2gls bibdoiadd bibexport bibmradd bibtex bibtex8 bibtexu biburl2doi bibzbladd convertgls2bib ctanbib listbib multibibliography pbibtex rubibtex upbibtex share/man/man1/ bibtex.1.gz bibtex8.1.gz bibtexu.1.gz rubibtex.1.gz share/texmf-dist/bibtex/csf/base/ 88591lat.csf 88591sca.csf ascii.csf cp437lat.csf cp850lat.csf cp850sca.csf cp866rus.csf csfile.txt share/texmf-dist/scripts/bib2gls/ bib2gls.sh convertgls2bib.sh share/texmf-dist/scripts/bibexport/bibexport.sh share/texmf-dist/scripts/crossrefware/ bbl2bib.pl bibdoiadd.pl bibmradd.pl biburl2doi.pl bibzbladd.pl share/texmf-dist/scripts/ctanbib/ctanbib share/texmf-dist/scripts/listbib/listbib share/texmf-dist/scripts/multibibliography/multibibliography.pl [FILE:92:manifests/plist.engine_hitex] bin/ hishrink histretch hitex share/man/man1/ hishrink.1.gz histretch.1.gz hitex.1.gz [FILE:1295:manifests/plist.engine_luatex] bin/ cllualatex dvilualatex dviluatex llmk luafindfont luajittex lualatex luaotfload-tool luatex mflua mflua-nowin mfluajit mfluajit-nowin texlua texluac texluajit texluajitc include/texlua53/ lauxlib.h lua.h lua.hpp luaconf.h lualib.h include/texluajit/ lauxlib.h lua.h lua.hpp luaconf.h luajit.h lualib.h lib/ libtexlua53.so libtexlua53.so.%%LIBTEXLUA53%% libtexlua53.so.%%LIBTEXLUA53_MAJOR%% libtexluajit.so libtexluajit.so.%%LIBTEXLUAJIT%% libtexluajit.so.%%LIBTEXLUAJIT_MAJOR%% lib/pkgconfig/ texlua53.pc texluajit.pc share/man/man1/ luatex.1.gz texlua.1.gz texluac.1.gz share/texmf-dist/scripts/checkcites/checkcites.lua share/texmf-dist/scripts/cluttex/cluttex.lua share/texmf-dist/scripts/diadia/diadia.lua share/texmf-dist/scripts/getmap/getmapdl.lua share/texmf-dist/scripts/glossaries/makeglossaries-lite.lua share/texmf-dist/scripts/l3build/l3build.lua share/texmf-dist/scripts/light-latex-make/llmk.lua share/texmf-dist/scripts/luaotfload/luaotfload-tool.lua share/texmf-dist/scripts/lwarp/lwarpmk.lua share/texmf-dist/scripts/m-tx/m-tx.lua share/texmf-dist/scripts/musixtex/ musixflx.lua musixtex.lua share/texmf-dist/scripts/pmxchords/pmxchords.lua share/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua share/texmf-dist/scripts/xindex/xindex.lua [FILE:2298:manifests/plist.engine_pdftex] bin/ amstex bg5+latex bg5+pdflatex bg5latex bg5pdflatex cef5latex cef5pdflatex ceflatex cefpdflatex cefslatex cefspdflatex cslatex csplain dvipdfm dvipdfmx dvipdft eplain epspdf epspdftk epstopdf etex fig4latex gbklatex gbkpdflatex git-latexdiff htlatex jadetex latex latex-git-log latex-papersize latex2man latex2nemeth latexdef latexdiff latexdiff-vc latexfileversion latexindent latexmk latexpand latexrevise mex mllatex mltex mptopdf pdfannotextractor pdfatfi pdfbook2 pdfcrop pdfcslatex pdfcsplain pdfetex pdfjadetex pdfjam pdflatex pdflatexpicscale pdfmex pdftex pdftex-quiet pdftosrc pdfxmltex pdfxup platex pn2pdf ps4pdf pslatex pst2pdf ptex2pdf repstopdf rpdfcrop simpdftex sjislatex sjispdflatex texsis thumbpdf uplatex utf8mex xdvipdfmx xhlatex xmltex share/man/man1/ dvipdfm.1.gz dvipdfmx.1.gz dvipdft.1.gz latex.1.gz pdfetex.1.gz pdflatex.1.gz pdftex.1.gz pdftosrc.1.gz pslatex.1.gz xdvipdfmx.1.gz share/texmf-dist/scripts/epspdf/ epspdf.tlu epspdftk.tcl share/texmf-dist/scripts/epstopdf/epstopdf.pl share/texmf-dist/scripts/fig4latex/fig4latex share/texmf-dist/scripts/git-latexdiff/git-latexdiff share/texmf-dist/scripts/latex-git-log/latex-git-log share/texmf-dist/scripts/latex-papersize/latex-papersize.py share/texmf-dist/scripts/latex2man/latex2man share/texmf-dist/scripts/latex2nemeth/latex2nemeth share/texmf-dist/scripts/latexdiff/ latexdiff-vc.pl latexdiff.pl latexrevise.pl share/texmf-dist/scripts/latexfileversion/latexfileversion share/texmf-dist/scripts/latexindent/latexindent.pl share/texmf-dist/scripts/latexmk/latexmk.pl share/texmf-dist/scripts/latexpand/latexpand share/texmf-dist/scripts/pax/pdfannotextractor.pl share/texmf-dist/scripts/pdfbook2/pdfbook2 share/texmf-dist/scripts/pdfcrop/pdfcrop.pl share/texmf-dist/scripts/pdfjam/pdfjam share/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl share/texmf-dist/scripts/pdftex-quiet/pdftex-quiet share/texmf-dist/scripts/pdfxup/pdfxup share/texmf-dist/scripts/petri-nets/pn2pdf share/texmf-dist/scripts/pst-pdf/ps4pdf share/texmf-dist/scripts/pst2pdf/pst2pdf.pl share/texmf-dist/scripts/simpdftex/simpdftex share/texmf-dist/scripts/tex4ht/ htlatex.sh xhlatex.sh share/texmf-dist/scripts/thumbpdf/thumbpdf.pl [FILE:167:manifests/plist.engine_xetex] bin/ clxelatex htxelatex htxetex xelatex xelatex-unsafe xetex xetex-unsafe share/man/man1/xetex.1.gz share/texmf-dist/scripts/tex4ht/ htxelatex.sh htxetex.sh [FILE:257:manifests/plist.synctex] bin/synctex include/synctex/ synctex_parser.h synctex_parser_utils.h synctex_version.h lib/ libsynctex.so libsynctex.so.%%LIBSYNCTEX%% libsynctex.so.%%LIBSYNCTEX_MAJOR%% lib/pkgconfig/synctex.pc share/man/man1/synctex.1.gz share/man/man5/synctex.5.gz [FILE:238:manifests/plist.tlmgr] %%SITE_PERL%%/TeXLive/ TLConfFile.pm TLConfig.pm TLCrypto.pm TLDownload.pm TLPDB.pm TLPOBJ.pm TLPSRC.pm TLPaper.pm TLTREE.pm TLUtils.pm TLWinGoo.pm TeXCatalogue.pm trans.pl bin/tlmgr share/texmf-dist/scripts/texlive/tlmgr.pl [FILE:1840:manifests/plist.utils] bin/ autosp axohelp bbox devnag lacheck pdfclose pdfopen pmxab prepmx ps2eps scor2prt t1ascii t1asm t1binary t1disasm t1mac t1unmac tex2aspc tex2xindy texdoctk texindy tpic2pdftex vlna xindy xindy.mem xindy.run share/man/man1/ autosp.1.gz axohelp.1.gz bbox.1.gz devnag.1.gz lacheck.1.gz pdfclose.1.gz pdfopen.1.gz pmxab.1.gz prepmx.1.gz ps2eps.1.gz scor2prt.1.gz t1ascii.1.gz t1asm.1.gz t1binary.1.gz t1disasm.1.gz t1mac.1.gz t1unmac.1.gz tex2aspc.1.gz tex2xindy.1.gz texdoctk.1.gz texindy.1.gz tpic2pdftex.1.gz vlna.1.gz xindy.1.gz share/texmf-dist/scripts/ps2eps/ps2eps.pl share/texmf-dist/scripts/texdoctk/texdoctk.pl share/texmf-dist/scripts/texlive-extra/ allcm.sh allneeded.sh dvi2fax.sh dvired.sh e2pall.pl fontinst.sh kpsetool.sh kpsewhere.sh ps2frag.sh pslatex.sh rubibtex.sh rumakeindex.sh texconfig-dialog.sh texconfig-sys.sh texconfig.sh texlinks.sh share/texmf-dist/scripts/xindy/ texindy.pl xindy.pl share/texmf-dist/xindy/VERSION share/texmf-dist/xindy/modules/base/ book-order.xdy ff-ranges-only.xdy ff-ranges.xdy german-sty.xdy ignore-hyphen.xdy ignore-punctuation.xdy keep-blanks.xdy latex-loc-fmts.xdy latex.xdy latin-lettergroups.xdy letter-order.xdy makeindex.xdy numeric-sort.xdy page-ranges.xdy tex.xdy texindy.xdy word-order.xdy share/texmf-dist/xindy/modules/class/pagenums.xdy share/texmf-dist/xindy/modules/lang/german/ din5007.xdy duden.xdy tex.xdy share/texmf-dist/xindy/modules/lang/korean/ utf8-lang.xdy utf8.xdy share/texmf-dist/xindy/modules/lang/latin/ caseisrt.xdy letgroup.xdy share/texmf-dist/xindy/modules/ord/letorder.xdy share/texmf-dist/xindy/modules/rules/ isolatin1-exchange.xdy isolatin1-tolower.xdy latin-exchange.xdy latin-tolower.xdy share/texmf-dist/xindy/modules/styles/ basic.xdy makeidx.xdy [FILE:238:patches/patch-texk_dvisvgm_dvisvgm-src_src_DVIActions.hpp] --- texk/dvisvgm/dvisvgm-src/src/DVIActions.hpp.orig 2023-01-20 01:55:04 UTC +++ texk/dvisvgm/dvisvgm-src/src/DVIActions.hpp @@ -23,6 +23,7 @@ #include #include +#include class BoundingBox; class Font; [FILE:239:patches/patch-texk_dvisvgm_dvisvgm-src_src_Pair.hpp] --- texk/dvisvgm/dvisvgm-src/src/Pair.hpp.orig 2023-01-20 01:55:04 UTC +++ texk/dvisvgm/dvisvgm-src/src/Pair.hpp @@ -23,6 +23,7 @@ #include #include +#include #include "macros.hpp" template [FILE:739:patches/patch-texk_kpathsea_texmf.cnf] --- texk/kpathsea/texmf.cnf.orig 2023-02-25 22:59:04 UTC +++ texk/kpathsea/texmf.cnf @@ -59,7 +59,7 @@ % SELFAUTOPARENT (its grandparent = /usr/local/texlive/YYYY), and % SELFAUTOGRANDPARENT (its great-grandparent = /usr/local/texlive). % Sorry for the off-by-one-generation names. -TEXMFROOT = $SELFAUTOPARENT +TEXMFROOT = $SELFAUTODIR/share % The main tree of distributed packages and programs: TEXMFDIST = $TEXMFROOT/texmf-dist @@ -69,7 +69,7 @@ TEXMFDIST = $TEXMFROOT/texmf-dist TEXMFMAIN = $TEXMFDIST % Local additions to the distribution trees. -TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local +TEXMFLOCAL = $TEXMFROOT/texmf-local % TEXMFSYSVAR, where *-sys store cached runtime data. TEXMFSYSVAR = $TEXMFROOT/texmf-var [FILE:400:patches/patch-texk_web2c_luatexdir_luaffi_ffi.h] --- texk/web2c/luatexdir/luaffi/ffi.h.orig 2019-01-20 23:58:29 UTC +++ texk/web2c/luatexdir/luaffi/ffi.h @@ -42,7 +42,7 @@ extern "C" { #include #endif -#if ( defined( _WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__)) +#if 0 /* We should include something equivalent to */ /* complex.h */ #else [FILE:36374:files/pdftoepdf-poppler0.76.0.cc] /* Copyright 1996-2017 Han The Thanh, This file is part of pdfTeX. pdfTeX is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. pdfTeX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This is based on the patch texlive-poppler-0.59.patch <2017-09-19> at https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk by Arch Linux. A little modifications are made to avoid a crash for some kind of pdf images, such as figure_missing.pdf in gnuplot. The poppler should be 0.76.0 or newer versions. POPPLER_VERSION should be defined. */ /* Do this early in order to avoid a conflict between MINGW32 defining 'boolean' as 'unsigned char' and defining Pascal's boolean as 'int'. */ #include #include #include #include #include #include #include #include #ifdef POPPLER_VERSION #include #include #include #include #include #define GString GooString #else #error POPPLER_VERSION should be defined. #endif #include #include "Object.h" #include "Stream.h" #include "Array.h" #include "Dict.h" #include "XRef.h" #include "Catalog.h" #include "Link.h" #include "Page.h" #include "GfxFont.h" #include "PDFDoc.h" #include "GlobalParams.h" #include "Error.h" // This file is mostly C and not very much C++; it's just used to interface // the functions of xpdf, which are written in C++. extern "C" { #include #include // These functions from pdftex.web gets declared in pdftexcoerce.h in the // usual web2c way, but we cannot include that file here because C++ // does not allow it. extern int getpdfsuppresswarningpagegroup(void); extern integer getpdfsuppressptexinfo(void); extern integer zround(double); } // The prefix "PTEX" for the PDF keys is special to pdfTeX; // this has been registered with Adobe by Hans Hagen. #define pdfkeyprefix "PTEX" #define MASK_SUPPRESS_PTEX_FULLBANNER 0x01 #define MASK_SUPPRESS_PTEX_FILENAME 0x02 #define MASK_SUPPRESS_PTEX_PAGENUMBER 0x04 #define MASK_SUPPRESS_PTEX_INFODICT 0x08 // When copying the Resources of the selected page, all objects are copied // recusively top-down. Indirect objects however are not fetched during // copying, but get a new object number from pdfTeX and then will be // appended into a linked list. Duplicates are checked and removed from the // list of indirect objects during appending. enum InObjType { objFont, objFontDesc, objOther }; struct InObj { Ref ref; // ref in original PDF InObjType type; // object type InObj *next; // next entry in list of indirect objects int num; // new object number in output PDF fd_entry *fd; // pointer to /FontDescriptor object structure int enc_objnum; // Encoding for objFont int written; // has it been written to output PDF? }; struct UsedEncoding { int enc_objnum; GfxFont *font; UsedEncoding *next; }; static InObj *inObjList; static UsedEncoding *encodingList; static bool isInit = false; // -------------------------------------------------------------------- // Maintain list of open embedded PDF files // -------------------------------------------------------------------- struct PdfDocument { char *file_name; PDFDoc *doc; XRef *xref; InObj *inObjList; int occurences; // number of references to the document; the doc can be // deleted when this is negative PdfDocument *next; }; static PdfDocument *pdfDocuments = 0; static XRef *xref = 0; // Returns pointer to PdfDocument record for PDF file. // Creates a new record if it doesn't exist yet. // xref is made current for the document. static PdfDocument *find_add_document(char *file_name) { PdfDocument *p = pdfDocuments; while (p && strcmp(p->file_name, file_name) != 0) p = p->next; if (p) { xref = p->xref; (p->occurences)++; return p; } p = new PdfDocument; p->file_name = xstrdup(file_name); p->xref = xref = 0; p->occurences = 0; GString *docName = new GString(p->file_name); p->doc = new PDFDoc(docName); // takes ownership of docName if (!p->doc->isOk() || !p->doc->okToPrint()) { pdftex_fail("xpdf: reading PDF image failed"); } p->inObjList = 0; p->next = pdfDocuments; pdfDocuments = p; return p; } // Deallocate a PdfDocument with all its resources static void delete_document(PdfDocument * pdf_doc) { PdfDocument **p = &pdfDocuments; while (*p && *p != pdf_doc) p = &((*p)->next); // should not happen: if (!*p) return; // unlink from list *p = pdf_doc->next; // free pdf_doc's resources InObj *r, *n; for (r = pdf_doc->inObjList; r != 0; r = n) { n = r->next; delete r; } xref = pdf_doc->xref; delete pdf_doc->doc; xfree(pdf_doc->file_name); delete pdf_doc; } // -------------------------------------------------------------------- static int addEncoding(GfxFont * gfont) { UsedEncoding *n; n = new UsedEncoding; n->next = encodingList; encodingList = n; n->font = gfont; n->enc_objnum = pdfnewobjnum(); return n->enc_objnum; } #define addFont(ref, fd, enc_objnum) \ addInObj(objFont, ref, fd, enc_objnum) // addFontDesc is only used to avoid writing the original FontDescriptor // from the PDF file. #define addFontDesc(ref, fd) \ addInObj(objFontDesc, ref, fd, 0) #define addOther(ref) \ addInObj(objOther, ref, 0, 0) static int addInObj(InObjType type, Ref ref, fd_entry * fd, int e) { InObj *p, *q, *n = new InObj; if (ref.num == 0) pdftex_fail("PDF inclusion: invalid reference"); n->ref = ref; n->type = type; n->next = 0; n->fd = fd; n->enc_objnum = e; n->written = 0; if (inObjList == 0) inObjList = n; else { for (p = inObjList; p != 0; p = p->next) { if (p->ref.num == ref.num && p->ref.gen == ref.gen) { delete n; return p->num; } q = p; } // it is important to add new objects at the end of the list, // because new objects are being added while the list is being // written out. q->next = n; } if (type == objFontDesc) n->num = get_fd_objnum(fd); else n->num = pdfnewobjnum(); return n->num; } #if 0 /* unusewd */ static int getNewObjectNumber(Ref ref) { InObj *p; if (inObjList == 0) { pdftex_fail("No objects copied yet"); } else { for (p = inObjList; p != 0; p = p->next) { if (p->ref.num == ref.num && p->ref.gen == ref.gen) { return p->num; } } pdftex_fail("Object not yet copied: %i %i", ref.num, ref.gen); } #ifdef _MSC_VER /* Never reached, but without __attribute__((noreturn)) for pdftex_fail() MSVC 5.0 requires an int return value. */ return -60000; #endif } #endif static void copyObject(Object *); static void copyName(char *s) { pdf_puts("/"); for (; *s != 0; s++) { if (isdigit(*s) || isupper(*s) || islower(*s) || *s == '_' || *s == '.' || *s == '-' || *s == '+') pdfout(*s); else pdf_printf("#%.2X", *s & 0xFF); } } static void copyDictEntry(Object * obj, int i) { Object obj1; copyName((char *)obj->dictGetKey(i)); pdf_puts(" "); obj1 = obj->dictGetValNF(i).copy(); copyObject(&obj1); pdf_puts("\n"); } static void copyDict(Object * obj) { int i, l; if (!obj->isDict()) pdftex_fail("PDF inclusion: invalid dict type <%s>", obj->getTypeName()); for (i = 0, l = obj->dictGetLength(); i < l; ++i) copyDictEntry(obj, i); } static void copyFontDict(Object * obj, InObj * r) { int i, l; char *key; if (!obj->isDict()) pdftex_fail("PDF inclusion: invalid dict type <%s>", obj->getTypeName()); pdf_puts("<<\n"); assert(r->type == objFont); // FontDescriptor is in fd_tree for (i = 0, l = obj->dictGetLength(); i < l; ++i) { key = (char *)obj->dictGetKey(i); if (strncmp("FontDescriptor", key, strlen("FontDescriptor")) == 0 || strncmp("BaseFont", key, strlen("BaseFont")) == 0 || strncmp("Encoding", key, strlen("Encoding")) == 0) continue; // skip original values copyDictEntry(obj, i); } // write new FontDescriptor, BaseFont, and Encoding pdf_printf("/FontDescriptor %d 0 R\n", get_fd_objnum(r->fd)); pdf_printf("/BaseFont %d 0 R\n", get_fn_objnum(r->fd)); pdf_printf("/Encoding %d 0 R\n", r->enc_objnum); pdf_puts(">>"); } static void copyStream(Stream * str) { int c, c2 = 0; str->reset(); while ((c = str->getChar()) != EOF) { pdfout(c); c2 = c; } pdflastbyte = c2; } static void copyProcSet(Object * obj) { int i, l; Object procset; if (!obj->isArray()) pdftex_fail("PDF inclusion: invalid ProcSet array type <%s>", obj->getTypeName()); pdf_puts("/ProcSet [ "); for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { procset = obj->arrayGetNF(i).copy(); if (!procset.isName()) pdftex_fail("PDF inclusion: invalid ProcSet entry type <%s>", procset.getTypeName()); copyName((char *)procset.getName()); pdf_puts(" "); } pdf_puts("]\n"); } #define REPLACE_TYPE1C true static bool embeddableFont(Object * fontdesc) { Object fontfile, ffsubtype; if (!fontdesc->isDict()) return false; fontfile = fontdesc->dictLookup("FontFile"); if (fontfile.isStream()) return true; if (REPLACE_TYPE1C) { fontfile = fontdesc->dictLookup("FontFile3"); if (!fontfile.isStream()) return false; ffsubtype = fontfile.streamGetDict()->lookup("Subtype"); return ffsubtype.isName() && !strcmp(ffsubtype.getName(), "Type1C"); } return false; } static void copyFont(char *tag, Object * fontRef) { Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset, stemV; GfxFont *gfont; fd_entry *fd; fm_entry *fontmap; // Check whether the font has already been embedded before analysing it. InObj *p; Ref ref = fontRef->getRef(); for (p = inObjList; p; p = p->next) { if (p->ref.num == ref.num && p->ref.gen == ref.gen) { copyName(tag); pdf_printf(" %d 0 R ", p->num); return; } } // Only handle included Type1 (and Type1C) fonts; anything else will be copied. // Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true. fontdict = fontRef->fetch(xref); fontdesc = Object(objNull); if (fontdict.isDict()) { subtype = fontdict.dictLookup("Subtype"); basefont = fontdict.dictLookup("BaseFont"); fontdescRef = fontdict.dictLookupNF("FontDescriptor").copy(); if (fontdescRef.isRef()) { fontdesc = fontdescRef.fetch(xref); } } if (!fixedinclusioncopyfont && fontdict.isDict() && subtype.isName() && !strcmp(subtype.getName(), "Type1") && basefont.isName() && fontdescRef.isRef() && fontdesc.isDict() && embeddableFont(&fontdesc) && (fontmap = lookup_fontmap((char *)basefont.getName())) != NULL) { // round /StemV value, since the PDF input is a float // (see Font Descriptors in PDF reference), but we only store an // integer, since we don't want to change the struct. stemV = fontdesc.dictLookup("StemV"); fd = epdf_create_fontdescriptor(fontmap, zround(stemV.getNum())); charset = fontdesc.dictLookup("CharSet"); if (!charset.isNull() && charset.isString() && is_subsetable(fontmap)) epdf_mark_glyphs(fd, (char *)charset.getString()->c_str()); else embed_whole_font(fd); addFontDesc(fontdescRef.getRef(), fd); copyName(tag); gfont = GfxFont::makeFont(xref, tag, fontRef->getRef(), fontdict.getDict()); pdf_printf(" %d 0 R ", addFont(fontRef->getRef(), fd, addEncoding(gfont))); } else { copyName(tag); pdf_puts(" "); copyObject(fontRef); } } static void copyFontResources(Object * obj) { Object fontRef; int i, l; if (!obj->isDict()) pdftex_fail("PDF inclusion: invalid font resources dict type <%s>", obj->getTypeName()); pdf_puts("/Font << "); for (i = 0, l = obj->dictGetLength(); i < l; ++i) { fontRef = obj->dictGetValNF(i).copy(); if (fontRef.isRef()) copyFont((char *)obj->dictGetKey(i), &fontRef); else if (fontRef.isDict()) { // some programs generate pdf with embedded font object copyName((char *)obj->dictGetKey(i)); pdf_puts(" "); copyObject(&fontRef); } else pdftex_fail("PDF inclusion: invalid font in reference type <%s>", fontRef.getTypeName()); } pdf_puts(">>\n"); } static void copyOtherResources(Object * obj, char *key) { // copies all other resources (write_epdf handles Fonts and ProcSets), // if Subtype is present, it must be a name if (strcmp("Subtype", key) == 0) { if (!obj->isName()) { pdftex_warn("PDF inclusion: Subtype in Resources dict is not a name" " (key '%s', type <%s>); ignored.", key, obj->getTypeName()); return; } } else if (!obj->isDict()) { //FIXME: Write the message only to the log file pdftex_warn("PDF inclusion: invalid other resource which is no dict" " (key '%s', type <%s>); ignored.", key, obj->getTypeName()); return; } copyName(key); pdf_puts(" "); copyObject(obj); } // Function onverts double to string; very small and very large numbers // are NOT converted to scientific notation. // n must be a number or real conforming to the implementation limits // of PDF as specified in appendix C.1 of the PDF Ref. // These are: // maximum value of ints is +2^32 // maximum value of reals is +2^15 // smalles values of reals is 1/(2^16) static char *convertNumToPDF(double n) { static const int precision = 6; static const int fact = (int) 1E6; // must be 10^precision static const double epsilon = 0.5E-6; // 2epsilon must be 10^-precision static char buf[64]; // handle very small values: return 0 if (fabs(n) < epsilon) { buf[0] = '0'; buf[1] = '\0'; } else { char ints[64]; int bindex = 0, sindex = 0; int ival, fval; // handle the sign part if n is negative if (n < 0) { buf[bindex++] = '-'; n = -n; } n += epsilon; // for rounding // handle the integer part, simply with sprintf ival = (int) floor(n); n -= ival; sprintf(ints, "%d", ival); while (ints[sindex] != 0) buf[bindex++] = ints[sindex++]; // handle the fractional part up to 'precision' digits fval = (int) floor(n * fact); if (fval) { // set a dot buf[bindex++] = '.'; sindex = bindex + precision; buf[sindex--] = '\0'; // fill up trailing zeros with the string terminator NULL while (((fval % 10) == 0) && (sindex >= bindex)) { buf[sindex--] = '\0'; fval /= 10; } // fill up the fractional part back to front while (sindex >= bindex) { buf[sindex--] = (fval % 10) + '0'; fval /= 10; } } else buf[bindex++] = 0; } return (char *) buf; } static void copyObject(Object * obj) { Object obj1; int i, l, c; Ref ref; char *p; GString *s; if (obj->isBool()) { pdf_printf("%s", obj->getBool()? "true" : "false"); } else if (obj->isInt()) { pdf_printf("%i", obj->getInt()); } else if (obj->isReal()) { pdf_printf("%s", convertNumToPDF(obj->getReal())); } else if (obj->isNum()) { pdf_printf("%s", convertNumToPDF(obj->getNum())); } else if (obj->isString()) { s = (GooString *)obj->getString(); p = (char *)s->c_str(); l = s->getLength(); if (strlen(p) == (unsigned int) l) { pdf_puts("("); for (; *p != 0; p++) { c = (unsigned char) *p; if (c == '(' || c == ')' || c == '\\') pdf_printf("\\%c", c); else if (c < 0x20 || c > 0x7F) pdf_printf("\\%03o", c); else pdfout(c); } pdf_puts(")"); } else { pdf_puts("<"); for (i = 0; i < l; i++) { c = s->getChar(i) & 0xFF; pdf_printf("%.2x", c); } pdf_puts(">"); } } else if (obj->isName()) { copyName((char *)obj->getName()); } else if (obj->isNull()) { pdf_puts("null"); } else if (obj->isArray()) { pdf_puts("["); for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { obj1 = obj->arrayGetNF(i).copy(); if (!obj1.isName()) pdf_puts(" "); copyObject(&obj1); } pdf_puts("]"); } else if (obj->isDict()) { pdf_puts("<<\n"); copyDict(obj); pdf_puts(">>"); } else if (obj->isStream()) { pdf_puts("<<\n"); copyDict(obj->getStream()->getDictObject()); pdf_puts(">>\n"); pdf_puts("stream\n"); copyStream(obj->getStream()->getUndecodedStream()); pdf_puts("\nendstream"); } else if (obj->isRef()) { ref = obj->getRef(); if (ref.num == 0) { pdftex_fail ("PDF inclusion: reference to invalid object" " (is the included pdf broken?)"); } else pdf_printf("%d 0 R", addOther(ref)); } else { pdftex_fail("PDF inclusion: type <%s> cannot be copied", obj->getTypeName()); } } static void writeRefs() { InObj *r; for (r = inObjList; r != 0; r = r->next) { if (!r->written) { r->written = 1; Object obj1 = xref->fetch(r->ref.num, r->ref.gen); if (r->type == objFont) { assert(!obj1.isStream()); pdfbeginobj(r->num, 2); // \pdfobjcompresslevel = 2 is for this copyFontDict(&obj1, r); pdf_puts("\n"); pdfendobj(); } else if (r->type != objFontDesc) { // /FontDescriptor is written via write_fontdescriptor() if (obj1.isStream()) pdfbeginobj(r->num, 0); else pdfbeginobj(r->num, 2); // \pdfobjcompresslevel = 2 is for this copyObject(&obj1); pdf_puts("\n"); pdfendobj(); } } } } static void writeEncodings() { UsedEncoding *r, *n; char *glyphNames[256], *s; int i; for (r = encodingList; r != 0; r = r->next) { for (i = 0; i < 256; i++) { if (r->font->isCIDFont()) { pdftex_fail ("PDF inclusion: CID fonts are not supported" " (try to disable font replacement to fix this)"); } if ((s = (char *)((Gfx8BitFont *) r->font)->getCharName(i)) != 0) glyphNames[i] = s; else glyphNames[i] = notdef; } epdf_write_enc(glyphNames, r->enc_objnum); } for (r = encodingList; r != 0; r = n) { n = r->next; #ifdef POPPLER_VERSION r->font->decRefCnt(); #else #error POPPLER_VERSION should be defined. #endif delete r; } } // get the pagebox according to the pagebox_spec static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec) { if (pagebox_spec == pdfboxspecmedia) return page->getMediaBox(); else if (pagebox_spec == pdfboxspeccrop) return page->getCropBox(); else if (pagebox_spec == pdfboxspecbleed) return page->getBleedBox(); else if (pagebox_spec == pdfboxspectrim) return page->getTrimBox(); else if (pagebox_spec == pdfboxspecart) return page->getArtBox(); else pdftex_fail("PDF inclusion: unknown value of pagebox spec (%i)", (int) pagebox_spec); return page->getMediaBox(); // to make the compiler happy } // Reads various information about the PDF and sets it up for later inclusion. // This will fail if the PDF version of the PDF is higher than // minor_pdf_version_wanted or page_name is given and can not be found. // It makes no sense to give page_name _and_ page_num. // Returns the page number. int read_pdf_info(char *image_name, char *page_name, int page_num, int pagebox_spec, int minor_pdf_version_wanted, int pdf_inclusion_errorlevel) { PdfDocument *pdf_doc; Page *page; const PDFRectangle *pagebox; #ifdef POPPLER_VERSION int pdf_major_version_found, pdf_minor_version_found; #else #error POPPLER_VERSION should be defined. #endif // initialize if (!isInit) { globalParams = new GlobalParams(); globalParams->setErrQuiet(false); isInit = true; } // open PDF file pdf_doc = find_add_document(image_name); epdf_doc = (void *) pdf_doc; // check PDF version // this works only for PDF 1.x -- but since any versions of PDF newer // than 1.x will not be backwards compatible to PDF 1.x, pdfTeX will // then have to changed drastically anyway. #ifdef POPPLER_VERSION pdf_major_version_found = pdf_doc->doc->getPDFMajorVersion(); pdf_minor_version_found = pdf_doc->doc->getPDFMinorVersion(); if ((pdf_major_version_found > 1) || (pdf_minor_version_found > minor_pdf_version_wanted)) { const char *msg = "PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed"; if (pdf_inclusion_errorlevel > 0) { pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted); } else if (pdf_inclusion_errorlevel < 0) { ; /* do nothing */ } else { /* = 0, give warning */ pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted); } } #else #error POPPLER_VERSION should be defined. #endif epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages(); if (page_name) { // get page by name GString name(page_name); LinkDest *link = pdf_doc->doc->findDest(&name); if (link == 0 || !link->isOk()) pdftex_fail("PDF inclusion: invalid destination <%s>", page_name); Ref ref = link->getPageRef(); page_num = pdf_doc->doc->getCatalog()->findPage(ref); if (page_num == 0) pdftex_fail("PDF inclusion: destination is not a page <%s>", page_name); delete link; } else { // get page by number if (page_num <= 0 || page_num > epdf_num_pages) pdftex_fail("PDF inclusion: required page does not exist <%i>", epdf_num_pages); } // get the required page page = pdf_doc->doc->getCatalog()->getPage(page_num); // get the pagebox (media, crop...) to use. pagebox = get_pagebox(page, pagebox_spec); if (pagebox->x2 > pagebox->x1) { epdf_orig_x = pagebox->x1; epdf_width = pagebox->x2 - pagebox->x1; } else { epdf_orig_x = pagebox->x2; epdf_width = pagebox->x1 - pagebox->x2; } if (pagebox->y2 > pagebox->y1) { epdf_orig_y = pagebox->y1; epdf_height = pagebox->y2 - pagebox->y1; } else { epdf_orig_y = pagebox->y2; epdf_height = pagebox->y1 - pagebox->y2; } // get page rotation epdf_rotate = page->getRotate() % 360; if (epdf_rotate < 0) epdf_rotate += 360; // page group if (page->getGroup() != NULL) epdf_has_page_group = 1; // only flag that page group is present; // the actual object number will be // generated in pdftex.web else epdf_has_page_group = 0; // no page group present pdf_doc->xref = pdf_doc->doc->getXRef(); return page_num; } // writes the current epf_doc. // Here the included PDF is copied, so most errors that can happen during PDF // inclusion will arise here. void write_epdf(void) { Page *page; Ref *pageRef; Dict *pageDict; Object contents, obj1, obj2, pageObj, dictObj; Object groupDict; bool writeSepGroup = false; Object info; char *key; char s[256]; int i, l; int rotate; double scale[6] = { 0, 0, 0, 0, 0, 0 }; bool writematrix = false; int suppress_ptex_info = getpdfsuppressptexinfo(); static const char *pageDictKeys[] = { "LastModified", "Metadata", "PieceInfo", "SeparationInfo", // "Group", // "Resources", NULL }; PdfDocument *pdf_doc = (PdfDocument *) epdf_doc; (pdf_doc->occurences)--; xref = pdf_doc->xref; inObjList = pdf_doc->inObjList; encodingList = 0; page = pdf_doc->doc->getCatalog()->getPage(epdf_selected_page); pageRef = pdf_doc->doc->getCatalog()->getPageRef(epdf_selected_page); pageObj = xref->fetch(pageRef->num, pageRef->gen); pageDict = pageObj.getDict(); rotate = page->getRotate(); const PDFRectangle *pagebox; // write the Page header pdf_puts("/Type /XObject\n"); pdf_puts("/Subtype /Form\n"); pdf_puts("/FormType 1\n"); // write additional information if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_FILENAME) == 0) { pdf_printf("/%s.FileName (%s)\n", pdfkeyprefix, convertStringToPDFString(pdf_doc->file_name, strlen(pdf_doc->file_name))); } if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_PAGENUMBER) == 0) { pdf_printf("/%s.PageNumber %i\n", pdfkeyprefix, (int) epdf_selected_page); } if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_INFODICT) == 0) { info = pdf_doc->doc->getDocInfoNF().copy(); if (info.isRef()) { // the info dict must be indirect (PDF Ref p. 61) pdf_printf("/%s.InfoDict ", pdfkeyprefix); pdf_printf("%d 0 R\n", addOther(info.getRef())); } } // get the pagebox (media, crop...) to use. pagebox = get_pagebox(page, epdf_page_box); // handle page rotation if (rotate != 0) { if (rotate % 90 == 0) { // this handles only the simple case: multiple of 90s but these // are the only values allowed according to the reference // (v1.3, p. 78). // the image is rotated around its center. // the /Rotate key is clockwise while the matrix is // counterclockwise :-% tex_printf(", page is rotated %d degrees", rotate); switch (rotate) { case 90: scale[1] = -1; scale[2] = 1; scale[4] = pagebox->x1 - pagebox->y1; scale[5] = pagebox->y1 + pagebox->x2; writematrix = true; break; case 180: scale[0] = scale[3] = -1; scale[4] = pagebox->x1 + pagebox->x2; scale[5] = pagebox->y1 + pagebox->y2; writematrix = true; break; // width and height are exchanged case 270: scale[1] = 1; scale[2] = -1; scale[4] = pagebox->x1 + pagebox->y2; scale[5] = pagebox->y1 - pagebox->x1; writematrix = true; break; } if (writematrix) { // The matrix is only written if the image is rotated. sprintf(s, "/Matrix [%.8f %.8f %.8f %.8f %.8f %.8f]\n", scale[0], scale[1], scale[2], scale[3], scale[4], scale[5]); pdf_puts(stripzeros(s)); } } } sprintf(s, "/BBox [%.8f %.8f %.8f %.8f]\n", pagebox->x1, pagebox->y1, pagebox->x2, pagebox->y2); pdf_puts(stripzeros(s)); // Metadata validity check (as a stream it must be indirect) dictObj = pageDict->lookupNF("Metadata").copy(); if (!dictObj.isNull() && !dictObj.isRef()) pdftex_warn("PDF inclusion: /Metadata must be indirect object"); // copy selected items in Page dictionary except Resources & Group for (i = 0; pageDictKeys[i] != NULL; i++) { dictObj = pageDict->lookupNF(pageDictKeys[i]).copy(); if (!dictObj.isNull()) { pdf_newline(); pdf_printf("/%s ", pageDictKeys[i]); copyObject(&dictObj); // preserves indirection } } // handle page group dictObj = pageDict->lookupNF("Group").copy(); if (!dictObj.isNull()) { if (pdfpagegroupval == 0) { // another pdf with page group was included earlier on the // same page; copy the Group entry as is. See manual for // info on why this is a warning. if (getpdfsuppresswarningpagegroup() == 0) { pdftex_warn ("PDF inclusion: multiple pdfs with page group included in a single page"); } pdf_newline(); pdf_puts("/Group "); copyObject(&dictObj); } else { // write Group dict as a separate object, since the Page dict also refers to it dictObj = pageDict->lookup("Group"); if (!dictObj.isDict()) pdftex_fail("PDF inclusion: /Group dict missing"); writeSepGroup = true; /* This part is only a single line groupDict = Object(page->getGroup()); in the original patch. In this case, however, pdftex crashes at "delete pdf_doc->doc" in "delete_document()" for inclusion of some kind of pdf images, for example, figure_missing.pdf in gnuplot. A change groupDict = Object(page->getGroup()).copy(); does not improve the situation. The changes below seem to work fine. */ // begin modification groupDict = pageDict->lookup("Group"); const Dict& dic1 = page->getGroup(); const Dict& dic2 = groupDict.getDict(); // replace dic2 in groupDict with dic1 l = dic2.getLength(); for (i = 0; i < l; i++) { groupDict.dictRemove(dic2.getKey(i)); } l = dic1.getLength(); for (i = 0; i < l; i++) { groupDict.dictAdd((const char *)copyString(dic1.getKey(i)), dic1.getValNF(i).copy()); } // end modification pdf_printf("/Group %ld 0 R\n", (long)pdfpagegroupval); } } // write the Resources dictionary if (page->getResourceDict() == NULL) { // Resources can be missing (files without them have been spotted // in the wild); in which case the /Resouces of the /Page will be used. // "This practice is not recommended". pdftex_warn ("PDF inclusion: /Resources missing. 'This practice is not recommended' (PDF Ref)"); } else { Object *obj1 = page->getResourceDictObject(); if (!obj1->isDict()) pdftex_fail("PDF inclusion: invalid resources dict type <%s>", obj1->getTypeName()); pdf_newline(); pdf_puts("/Resources <<\n"); for (i = 0, l = obj1->dictGetLength(); i < l; ++i) { obj2 = obj1->dictGetVal(i); key = (char *)obj1->dictGetKey(i); if (strcmp("Font", key) == 0) copyFontResources(&obj2); else if (strcmp("ProcSet", key) == 0) copyProcSet(&obj2); else copyOtherResources(&obj2, (char *)key); } pdf_puts(">>\n"); } // write the page contents contents = page->getContents(); if (contents.isStream()) { // Variant A: get stream and recompress under control // of \pdfcompresslevel // // pdfbeginstream(); // copyStream(contents->getStream()); // pdfendstream(); // Variant B: copy stream without recompressing // obj1 = contents.streamGetDict()->lookup("F"); if (!obj1.isNull()) { pdftex_fail("PDF inclusion: Unsupported external stream"); } obj1 = contents.streamGetDict()->lookup("Length"); assert(!obj1.isNull()); pdf_puts("/Length "); copyObject(&obj1); pdf_puts("\n"); obj1 = contents.streamGetDict()->lookup("Filter"); if (!obj1.isNull()) { pdf_puts("/Filter "); copyObject(&obj1); pdf_puts("\n"); obj1 = contents.streamGetDict()->lookup("DecodeParms"); if (!obj1.isNull()) { pdf_puts("/DecodeParms "); copyObject(&obj1); pdf_puts("\n"); } } pdf_puts(">>\nstream\n"); copyStream(contents.getStream()->getUndecodedStream()); pdfendstream(); } else if (contents.isArray()) { pdfbeginstream(); for (i = 0, l = contents.arrayGetLength(); i < l; ++i) { Object contentsobj = contents.arrayGet(i); copyStream(contentsobj.getStream()); if (i < l - 1) pdf_newline(); // add a newline after each stream except the last } pdfendstream(); } else { // the contents are optional, but we need to include an empty stream pdfbeginstream(); pdfendstream(); } // write out all indirect objects writeRefs(); // write out all used encodings (and delete list) writeEncodings(); // write the Group dict if needed if (writeSepGroup) { pdfbeginobj(pdfpagegroupval, 2); copyObject(&groupDict); pdf_puts("\n"); pdfendobj(); pdfpagegroupval = 0; // only the 1st included pdf on a page gets its // Group included in the Page dict } // save object list, xref pdf_doc->inObjList = inObjList; pdf_doc->xref = xref; } // Called when an image has been written and it's resources in image_tab are // freed and it's not referenced anymore. void epdf_delete() { PdfDocument *pdf_doc = (PdfDocument *) epdf_doc; xref = pdf_doc->xref; if (pdf_doc->occurences < 0) { delete_document(pdf_doc); } } // Called when PDF embedding system is finalized. // Now deallocate all remaining PdfDocuments. void epdf_check_mem() { if (isInit) { PdfDocument *p, *n; for (p = pdfDocuments; p; p = n) { n = p->next; delete_document(p); } // see above for globalParams delete globalParams; } } [FILE:6684:files/pdftosrc-poppler0.76.0.cc] /* Copyright 1996-2017 Han The Thanh, This file is part of pdfTeX. pdfTeX is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. pdfTeX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* This is based on the patch texlive-poppler-0.59.patch <2017-09-19> at https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk by Arch Linux. The poppler should be 0.76.0 or newer versions. POPPLER_VERSION should be defined. */ #include #include #include #include #include #include #ifdef POPPLER_VERSION #define GString GooString #define xpdfVersion POPPLER_VERSION #include #include #include #include #else #error POPPLER_VERSION should be defined. #endif #include #include "Object.h" #include "Stream.h" #include "Lexer.h" #include "Parser.h" #include "Array.h" #include "Dict.h" #include "XRef.h" #include "Catalog.h" #include "Page.h" #include "GfxFont.h" #include "PDFDoc.h" #include "GlobalParams.h" #include "Error.h" static XRef *xref = 0; int main(int argc, char *argv[]) { char *p, buf[1024]; PDFDoc *doc; GString *fileName; Stream *s; Object srcStream, srcName, catalogDict; FILE *outfile; char *outname; int objnum = 0, objgen = 0; bool extract_xref_table = false; int c; fprintf(stderr, "pdftosrc version %s\n", xpdfVersion); if (argc < 2) { fprintf(stderr, "Usage: pdftosrc []\n"); exit(1); } fileName = new GString(argv[1]); globalParams = new GlobalParams(); doc = new PDFDoc(fileName); if (!doc->isOk()) { fprintf(stderr, "Invalid PDF file\n"); exit(1); } if (argc >= 3) { objnum = atoi(argv[2]); if (argc >= 4) objgen = atoi(argv[3]); } xref = doc->getXRef(); catalogDict = xref->getCatalog(); if (!catalogDict.isDict("Catalog")) { fprintf(stderr, "No Catalog found\n"); exit(1); } srcStream = Object(objNull); if (objnum == 0) { srcStream = catalogDict.dictLookup("SourceObject"); static char const_SourceFile[] = "SourceFile"; if (!srcStream.isStream(const_SourceFile)) { fprintf(stderr, "No SourceObject found\n"); exit(1); } srcName = srcStream.getStream()->getDict()->lookup("SourceName"); if (!srcName.isString()) { fprintf(stderr, "No SourceName found\n"); exit(1); } outname = (char *)srcName.getString()->c_str(); // We cannot free srcName, as objname shares its string. // srcName.free(); } else if (objnum > 0) { srcStream = xref->fetch(objnum, objgen); if (!srcStream.isStream()) { fprintf(stderr, "Not a Stream object\n"); exit(1); } sprintf(buf, "%s", fileName->c_str()); if ((p = strrchr(buf, '.')) == 0) p = strchr(buf, 0); if (objgen == 0) sprintf(p, ".%i", objnum); else sprintf(p, ".%i+%i", objnum, objgen); outname = buf; } else { // objnum < 0 means we are extracting the XRef table extract_xref_table = true; sprintf(buf, "%s", fileName->c_str()); if ((p = strrchr(buf, '.')) == 0) p = strchr(buf, 0); sprintf(p, ".xref"); outname = buf; } if (!(outfile = fopen(outname, "wb"))) { fprintf(stderr, "Cannot open file \"%s\" for writing\n", outname); exit(1); } if (extract_xref_table) { int size = xref->getNumObjects(); int i; for (i = 0; i < size; i++) { if (xref->getEntry(i)->offset == 0xffffffff) break; } size = i; fprintf(outfile, "xref\n"); fprintf(outfile, "0 %i\n", size); for (i = 0; i < size; i++) { XRefEntry *e = xref->getEntry(i); if (e->type != xrefEntryCompressed) fprintf(outfile, "%.10lu %.5i %s\n", (long unsigned) e->offset, e->gen, (e->type == xrefEntryFree ? "f" : "n")); else { // e->offset is the object number of the object stream Stream *str; Lexer *lexer; Parser *parser; Object objStr, obj1, obj2; int nObjects, first, n; int localOffset = 0; unsigned int firstOffset; objStr = xref->fetch(e->offset, 0); assert(objStr.isStream()); obj1 = objStr.streamGetDict()->lookup("N"); nObjects = obj1.getInt(); obj1 = objStr.streamGetDict()->lookup("First"); first = obj1.getInt(); firstOffset = objStr.getStream()->getBaseStream()->getStart() + first; // parse the header: object numbers and offsets objStr.streamReset(); str = new EmbedStream(objStr.getStream(), Object(objNull), true, first); parser = new Parser(xref, str, false); for (n = 0; n < nObjects; ++n) { obj1 = parser->getObj(); obj2 = parser->getObj(); if (n == e->gen) localOffset = obj2.getInt(); } while (str->getChar() != EOF) ; delete parser; fprintf(outfile, "%.10lu 00000 n\n", (long unsigned)(firstOffset + localOffset)); } } } else { s = srcStream.getStream(); s->reset(); while ((c = s->getChar()) != EOF) fputc(c, outfile); } if (objnum == 0) fprintf(stderr, "Source file extracted to %s\n", outname); else if (objnum > 0) fprintf(stderr, "Stream object extracted to %s\n", outname); else fprintf(stderr, "Cross-reference table extracted to %s\n", outname); fclose(outfile); delete doc; delete globalParams; } [FILE:173:files/pkg-message-primary.in] This subpackage provides the basic TeX engines only (which just support DVI output). You almost certainly want to install one of the advanced engines targeting PDF as well. [FILE:1564:files/special.mk] PDFTEX_LINKS= amstex cslatex csplain eplain etex jadetex latex mex \ mllatex mltex pdfcslatex pdfcsplain pdfetex pdfjadetex \ pdflatex pdfmex pdfxmltex texsis utf8mex xmltex PROGRAMS0= afm2pl afm2tfm aleph autosp axohelp bbox bg5conv \ bibtex bibtex8 bibtexu cef5conv cefconv cefsconv \ cfftot1 chkdvifont chktex ctangle ctie ctwill \ ctwill-refsort ctwill-twinx cweave detex devnag \ disdvi dt2dv dv2dt dvi2tty dvibook dviconcat dvicopy \ dvidvi dvilj dvilj2p dvilj4 dvilj4l dvipng dvipos \ dvips dviselect dvispc dvisvgm dvitodvi dvitype \ epsffit eptex euptex extconv gftodvi gftopk gftype \ gregorio gsftopk PROGRAMS1= hbf2gf hishrink histretch hitex kpseaccess kpsereadlink \ kpsestat kpsewhich lacheck luajittex luatex mag \ makeindex makejvf mendex mf mf-nowin mflua mfluajit mft \ mmafm mmpfb mpost msxlint odvicopy odvitype omfonts \ otangle otfinfo otftotfm otp2ocp outocp patgen pbibtex \ pdfclose pdfopen pdftex pdftosrc pdvitype pfb2pfa pk2bm \ pktogf pktype pltotf pmpost pmxab pooltype ppltotf \ prepmx ps2pk psbook psnup psresize psselect pstops PROGRAMS2= ptex ptftopl scor2prt sjisconv synctex t1ascii t1asm \ t1binary t1disasm t1dotlessj t1lint t1mac t1rawafm \ t1reencode t1testpage t1unmac t4ht tangle teckit_compile \ tex tex2aspc tex2xindy tex4ht tftopl tie ttf2afm ttf2pk \ ttf2tfm ttfdump ttftotype42 twill updvitype upbibtex \ upmendex upmpost uppltotf uptex uptftopl vftovp vlna \ vptovf weave wofm2opl wopl2ofm wovf2ovp wovp2ovf \ xdvi-xaw xdvipdfmx xetex luahbtex luajithbtex xml2pmx