From 90a8327e9b036ece000905d54a316b792d891e0b Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 10 Feb 2024 08:13:48 +0000 Subject: revert (xpdf 4.05 to xpdf 4.04) git-svn-id: svn://tug.org/texlive/trunk@69766 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/xpdf/xpdf-src/ANNOUNCE | 31 +- Build/source/libs/xpdf/xpdf-src/CHANGES | 80 --- Build/source/libs/xpdf/xpdf-src/INSTALL | 21 +- Build/source/libs/xpdf/xpdf-src/README | 6 +- Build/source/libs/xpdf/xpdf-src/aconf2.h | 41 ++ Build/source/libs/xpdf/xpdf-src/cmake-config.txt | 39 +- Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 | 11 +- Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat | 10 +- Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 | 11 +- Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat | 12 +- Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 | 16 +- Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat | 14 +- Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 | 19 +- Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat | 31 +- Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 | 20 +- Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat | 31 +- Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 | 16 +- Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat | 14 +- Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 | 16 +- Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat | 14 +- Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 | 11 +- Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat | 20 +- Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 | 11 +- Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat | 12 +- Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 | 26 +- Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat | 170 +++--- Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 | 52 +- Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat | 231 ++++---- Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc | 4 + Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h | 4 + .../libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc | 4 + .../source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h | 4 + .../libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc | 6 +- .../libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h | 4 + .../source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc | 31 +- .../source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h | 4 + Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc | 4 + Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h | 4 + Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc | 199 +++---- Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h | 4 + Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc | 4 + Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h | 4 + Build/source/libs/xpdf/xpdf-src/goo/GHash.cc | 4 + Build/source/libs/xpdf/xpdf-src/goo/GHash.h | 4 + Build/source/libs/xpdf/xpdf-src/goo/GList.cc | 9 +- Build/source/libs/xpdf/xpdf-src/goo/GList.h | 7 +- Build/source/libs/xpdf/xpdf-src/goo/GString.cc | 6 +- Build/source/libs/xpdf/xpdf-src/goo/GString.h | 4 + Build/source/libs/xpdf/xpdf-src/goo/gfile.cc | 25 +- Build/source/libs/xpdf/xpdf-src/goo/gfile.h | 6 - Build/source/libs/xpdf/xpdf-src/splash/Splash.cc | 581 +++++++++------------ Build/source/libs/xpdf/xpdf-src/splash/Splash.h | 6 +- .../libs/xpdf/xpdf-src/splash/SplashBitmap.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashBitmap.h | 4 + .../source/libs/xpdf/xpdf-src/splash/SplashClip.cc | 6 +- .../source/libs/xpdf/xpdf-src/splash/SplashClip.h | 14 +- .../libs/xpdf/xpdf-src/splash/SplashFTFont.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashFTFont.h | 4 + .../xpdf/xpdf-src/splash/SplashFTFontEngine.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashFTFontFile.h | 4 + .../source/libs/xpdf/xpdf-src/splash/SplashFont.cc | 4 + .../source/libs/xpdf/xpdf-src/splash/SplashFont.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashFontEngine.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashFontEngine.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashFontFile.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashFontFile.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashFontFileID.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashFontFileID.h | 4 + .../source/libs/xpdf/xpdf-src/splash/SplashPath.cc | 4 + .../source/libs/xpdf/xpdf-src/splash/SplashPath.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashPattern.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashPattern.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashScreen.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashScreen.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashState.cc | 4 + .../source/libs/xpdf/xpdf-src/splash/SplashState.h | 4 + .../libs/xpdf/xpdf-src/splash/SplashXPath.cc | 61 +-- .../source/libs/xpdf/xpdf-src/splash/SplashXPath.h | 11 +- .../xpdf/xpdf-src/splash/SplashXPathScanner.cc | 4 + .../libs/xpdf/xpdf-src/splash/SplashXPathScanner.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc | 40 +- Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h | 6 +- Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc | 396 ++++++-------- Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h | 52 +- Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc | 8 +- Build/source/libs/xpdf/xpdf-src/xpdf/Array.h | 4 + .../source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc | 282 ++-------- Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h | 15 +- .../libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc | 18 +- .../libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc | 36 +- Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h | 4 + .../source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc | 4 + .../source/libs/xpdf/xpdf-src/xpdf/DisplayState.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Error.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Function.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc | 514 +++++++----------- Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h | 9 +- Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc | 269 +++------- Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h | 18 +- Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc | 456 ++++------------ Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h | 19 +- .../source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc | 243 +-------- .../source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h | 30 +- Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc | 72 +-- Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.h | 24 +- .../libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc | 8 +- .../libs/xpdf/xpdf-src/xpdf/ImageOutputDev.h | 4 + .../libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc | 4 + .../libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.h | 4 + .../source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc | 28 +- Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.h | 5 +- Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.cc | 21 +- Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.h | 5 +- Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.cc | 19 +- Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Link.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Link.h | 4 + .../libs/xpdf/xpdf-src/xpdf/NameToCharCode.cc | 4 + .../libs/xpdf/xpdf-src/xpdf/NameToCharCode.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Object.cc | 14 +- Build/source/libs/xpdf/xpdf-src/xpdf/Object.h | 8 +- .../libs/xpdf/xpdf-src/xpdf/OptionalContent.cc | 4 + .../libs/xpdf/xpdf-src/xpdf/OptionalContent.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Outline.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Outline.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.cc | 13 +- Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.h | 28 +- .../libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc | 4 + .../source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.cc | 129 ++--- Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.h | 53 +- Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc | 16 +- Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.h | 13 +- .../source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc | 320 ++++-------- Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h | 25 +- .../source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Page.cc | 19 +- Build/source/libs/xpdf/xpdf-src/xpdf/Page.h | 5 +- Build/source/libs/xpdf/xpdf-src/xpdf/Parser.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/Parser.h | 4 + .../libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc | 4 + .../libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.h | 4 + .../libs/xpdf/xpdf-src/xpdf/SecurityHandler.cc | 4 + .../libs/xpdf/xpdf-src/xpdf/SecurityHandler.h | 4 + .../source/libs/xpdf/xpdf-src/xpdf/ShadingImage.cc | 18 +- .../source/libs/xpdf/xpdf-src/xpdf/ShadingImage.h | 4 + .../libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc | 188 +++---- .../libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h | 17 +- Build/source/libs/xpdf/xpdf-src/xpdf/Stream.cc | 24 +- Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h | 12 +- .../libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc | 569 +++++--------------- .../source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h | 35 +- Build/source/libs/xpdf/xpdf-src/xpdf/TextString.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/TextString.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.cc | 6 +- Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.h | 4 + .../libs/xpdf/xpdf-src/xpdf/TileCompositor.cc | 4 + .../libs/xpdf/xpdf-src/xpdf/TileCompositor.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.cc | 14 +- Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.h | 4 + .../libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc | 4 + .../libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h | 4 + .../libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.cc | 132 ++--- .../libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.h | 2 - Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.cc | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.h | 4 + Build/source/libs/xpdf/xpdf-src/xpdf/XRef.cc | 93 ++-- Build/source/libs/xpdf/xpdf-src/xpdf/XRef.h | 9 +- Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.cc | 12 +- Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.h | 5 +- Build/source/libs/xpdf/xpdf-src/xpdf/config.h | 16 +- Build/source/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc | 11 - Build/source/libs/xpdf/xpdf-src/xpdf/pdffonts.cc | 20 +- Build/source/libs/xpdf/xpdf-src/xpdf/pdfimages.cc | 11 - Build/source/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc | 61 +-- Build/source/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc | 38 +- Build/source/libs/xpdf/xpdf-src/xpdf/pdftopng.cc | 11 - Build/source/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc | 11 - Build/source/libs/xpdf/xpdf-src/xpdf/pdftops.cc | 11 - Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc | 11 - 196 files changed, 2441 insertions(+), 4454 deletions(-) create mode 100644 Build/source/libs/xpdf/xpdf-src/aconf2.h (limited to 'Build/source/libs/xpdf/xpdf-src') diff --git a/Build/source/libs/xpdf/xpdf-src/ANNOUNCE b/Build/source/libs/xpdf/xpdf-src/ANNOUNCE index c7028e7ff0c..c20dcaf47ae 100644 --- a/Build/source/libs/xpdf/xpdf-src/ANNOUNCE +++ b/Build/source/libs/xpdf/xpdf-src/ANNOUNCE @@ -1,4 +1,4 @@ -Subject: ANNOUNCE: Xpdf 4.05 - a PDF viewer and related tools +Subject: ANNOUNCE: Xpdf 4.04 - a PDF viewer and related tools Glyph & Cog, LLC is pleased to announce a new version of Xpdf, the open source Portable Document Format (PDF) viewer. The Xpdf project @@ -10,29 +10,16 @@ non-graphical components (pdftops, pdftotext, etc.) run on Linux, Unix, Windows, MacOSX, and pretty much any other system with a decent C++ compiler. -4.05 is primarily a bug fix release. There are some new features: - -* New command line options/features: - - Added the '-overwrite' option to pdftohtml. - - Added the '-custom' flag to pdfinfo. - - Added the '-meta' flag to pdftohtml. - - Added the 'uses JavaScript' output to pdfinfo. - -* New configuration options: - - Added the 'ignoreWrongSizeToUnicode' xpdfrc setting. - - Added the zoomScaleFactor xpdfrc setting. - - Added the zoomValues xpdfrc setting. - - Added the separateRotatedText xpdfrc setting. - - Added the allowLinksToChangeZoom xpdfrc setting. +4.04 is primarily a bug fix release. There are some new features: * XpdfReader improvements: - - Added the loadSession and saveSession commands, and the 'Load last - session' menu item. - - Added code to automatically save and restore the xpdf session - under control of a session manager. (This has not been thoroughly - tested yet.) - - Added a 'smart case' option for search in xpdf. - - Added a color/gray/mono switch to the 'save image' dialog. + - Implemented selection extension via shift-click, and word/line + selection via double/triple click. + - Added default bindings for ctrl-mousewheel-up/down to zoom in/out. + - Added a help menu item that shows all of the key bindings. + +* Various new command line options for pdftotext, pdftohtml, pdftoppm, + pdftopng, and xpdf. See the `CHANGES' file for a complete list of changes. diff --git a/Build/source/libs/xpdf/xpdf-src/CHANGES b/Build/source/libs/xpdf/xpdf-src/CHANGES index 3a40c2995e0..564aff32b4f 100644 --- a/Build/source/libs/xpdf/xpdf-src/CHANGES +++ b/Build/source/libs/xpdf/xpdf-src/CHANGES @@ -2810,83 +2810,3 @@ Added an integer overflow check in JPXStream. (JPXStream issue) The DCT (JPEG) decoder was allowing the 'interleaved' flag to be changed after the first scan of the image. (CVE-2022-24106) [Thanks to Shin Ando @ Ricera Security for the bug report.] - -4.05 (2024-feb-08) ------------------- -Added the '-overwrite' option to pdftohtml. -Added the 'ignoreWrongSizeToUnicode' xpdfrc setting. -Added the loadSession and saveSession commands, and the 'Load last - session' menu item. -Added code to automatically save and restore the xpdf session under - control of a session manager. This has not been thoroughly tested - yet. -Added the zoomScaleFactor xpdfrc setting. -Added the zoomValues xpdfrc setting. -Added a 'smart case' option for search in xpdf. -Added the '-custom' flag to pdfinfo. -Added a color/gray/mono switch to the 'save image' dialog. -Added the separateRotatedText xpdfrc setting. -Added the '-meta' flag to pdftohtml. -Added the allowLinksToChangeZoom xpdfrc setting. -Added the 'uses JavaScript' output to pdfinfo. -Implemented pattern stroking of text. Also fixed the various - combinations of filling/stroking with color/pattern + clipping, some - of which weren't being handled correctly. -Pdftops now (re)compresses any uncompressed or RLE-compressed images. -On an out-of-memory error, the command line tools now exit with an - "out of memory" message, rather than an exception message. -Add code to pdfimages to extract images from tiling patterns. -Pdftops can now embed external 8-bit OpenType CFF fonts. -Fixed a corner case in the text extractor related to characters drawn - at extremely large coordinates. [Thanks to elvadisas for the bug - report.] -Fixed an integer overflow in the transparency group code. [Thanks to - elvadisas for the bug report.] -Modify Annots::Annots() to skip annotations that have been turned into - AcroFormFields -- invalid Widget-type annots will now be rendered as - annots. -Added a missing integer overflow check in the JBIG2 decoder. [Thanks - to sangjun for the bug report.] -Added some sanity checks to the JBIG2 decoder. [Thanks to sangjun and - ycdxsb for the bug reports.] -Tiling patterns that use non-Normal blend modes can't be cached. -Fixed a bitmap size sanity check in the JBIG2 decoder. [Thanks to Han - Zheng (NCNIPC of China, Hexhive), for the bug report.] -Fixed a missing bounds check in FoFiType1C::convertToOpenType (used in - pdftohtml). [Thanks to cyth for the bug report.] -Fixed a use-after-free bug in pdftohtml. [Thanks to FeRDNYC for the - bug report.] -Merged aconf2.h into aconf.h; corrected the cmake config settings for - paths; added the BASE14_FONT_DIR config option. [Thanks to FeRDNYC - for the suggestions.] -Fixed a missing check for a zero-length index in the CFF (Type1C) font - parser. [Thanks to Yuhang Huang (NCNIPC of China), Han Zheng - (NCNIPC of China, Hexhive), Wanying Cao, Jiayu Zhao (NCNIPC of - China) for the bug report.] -Add an object loop check to Catalog::countPageTree(). -The DCT decoder wasn't checking for an SOF before the first SOS. - [Thanks to cyth for the bug report.] -The inline image decoder was skipping to end-of-stream in the wrong - stream object. [Thanks to cyth for the bug report.] -Fixed a bug in the JPEG 2000 decoder when nLayers > 1 and the - 'termination on each coding pass' flag is set. -Removed the #pragma interface/implementation stuff (which is outdated - and useless at this point). -Fixed a bug in the ICCBased color space parser that was allowing the - number of components to be zero. (CVE-2023-2662) [Thanks to - huckleberry for the bug report.] -Added checks for PDF object loops in AcroForm::scanField() - (CVE-2018-7453, CVE-2018-16369, CVE-2022-36561, CVE-2022-41844), - Catalog::readPageLabelTree2() (CVE-2023-2663), and - Catalog::readEmbeddedFileTree() (CVE-2023-2664). -The zero-width character problem can also happen if the page size is - very large -- that needs to be limited too, the same way as - character position coordinates. (CVE-2023-3044) [Thanks to jlinliu - for the bug report.] -Add some missing bounds check code in DCTStream. [Thanks to Jiahao - Liu for the bug report.] -Fix a deadlock when an object stream's length field is contained in - another object stream. (CVE-2023-3436) [Thanks to Jiahao Liu for - the bug report.] -Correctly handle tiling patterns with negative step values. -Ignore overprint in soft masks (to match Adobe's behavior). diff --git a/Build/source/libs/xpdf/xpdf-src/INSTALL b/Build/source/libs/xpdf/xpdf-src/INSTALL index 0dd151ca26a..57ff61f2156 100644 --- a/Build/source/libs/xpdf/xpdf-src/INSTALL +++ b/Build/source/libs/xpdf/xpdf-src/INSTALL @@ -1,11 +1,11 @@ Xpdf ==== -version 4.05 -2024-feb-08 +version 4.04 +2022-apr-18 The Xpdf software and documentation are -copyright 1996-2024 Glyph & Cog, LLC. +copyright 1996-2022 Glyph & Cog, LLC. Email: xpdf@xpdfreader.com WWW: http://www.xpdfreader.com/ @@ -34,8 +34,8 @@ different systems. - CMake 2.8.8 or newer - FreeType 2.0.5 or newer - Qt 5.x or 6.x (for xpdf only) - - libpng (for pdftopng and pdftohtml) - - zlib (for pdftopng and pdftohtml) + - libpng (for pdftoppm and pdftohtml) + - zlib (for pdftoppm and pdftohtml) If Qt isn't found, the GUI viewer (xpdf) won't be built, but the command line tools will still be built. @@ -119,12 +119,6 @@ different systems. The ${DATADIR} variable in xpdfrc config files will expand to this string. - -DBASE14_FONT_DIR="/usr/share/fonts/type1" - By default, Xpdf will look for the URW Type 1 fonts in several - quasi-standard directories on Linux/Mac systems. This option - adds another directory to that search path. On Windows, this - does the same thing, except for the system TrueType fonts. - -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1 -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1 Do not search for the Qt4/Qt5 libraries. This will disable @@ -147,11 +141,6 @@ different systems. Set the man directory, relative to CMAKE_INSTALL_PREFIX (typically "man" or "share/man"). - -DCMAKE_CXX_FLAGS="... -DDISABLE_SESSION_MANAGEMENT" - Disable the session manager interface, i.e., do not - automatically save and restore sessions under control of the - session manager. - * Build: make diff --git a/Build/source/libs/xpdf/xpdf-src/README b/Build/source/libs/xpdf/xpdf-src/README index e973db5e58e..026460dd24b 100644 --- a/Build/source/libs/xpdf/xpdf-src/README +++ b/Build/source/libs/xpdf/xpdf-src/README @@ -1,11 +1,11 @@ Xpdf ==== -version 4.05 -2024-feb-08 +version 4.04 +2022-apr-18 The Xpdf software and documentation are -copyright 1996-2024 Glyph & Cog, LLC. +copyright 1996-2022 Glyph & Cog, LLC. Email: xpdf@xpdfreader.com WWW: http://www.xpdfreader.com/ diff --git a/Build/source/libs/xpdf/xpdf-src/aconf2.h b/Build/source/libs/xpdf/xpdf-src/aconf2.h new file mode 100644 index 00000000000..05d785c274a --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-src/aconf2.h @@ -0,0 +1,41 @@ +/* + * aconf2.h + * + * This gets included by aconf.h, and contains miscellaneous global + * settings not directly controlled by autoconf. This is a separate + * file because otherwise the configure script will munge any + * #define/#undef constructs. + * + * Copyright 2002-2003 Glyph & Cog, LLC + */ + +#ifndef ACONF2_H +#define ACONF2_H + +/* + * This controls the use of the interface/implementation pragmas. + */ +#if defined(__GNUC__) && !defined(__clang__) +#define USE_GCC_PRAGMAS +#endif +/* There is a bug in the version of gcc which ships with MacOS X 10.2 */ +#if defined(__APPLE__) && defined(__MACH__) +# include +#endif +#ifdef MAC_OS_X_VERSION_MAX_ALLOWED +# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 +# undef USE_GCC_PRAGMAS +# endif +#endif + +/* + * Speed up Windows compilation. This will only work for the command + * line tools. + */ +/* + *#ifdef _WIN32 + *# define WIN32_LEAN_AND_MEAN + *#endif + */ + +#endif diff --git a/Build/source/libs/xpdf/xpdf-src/cmake-config.txt b/Build/source/libs/xpdf/xpdf-src/cmake-config.txt index e49962c5eea..f9339b9fc81 100644 --- a/Build/source/libs/xpdf/xpdf-src/cmake-config.txt +++ b/Build/source/libs/xpdf/xpdf-src/cmake-config.txt @@ -92,17 +92,24 @@ option(USE_EXCEPTIONS "use C++ exceptions" ON) option(USE_FIXEDPOINT "use fixed point (instead of floating point) arithmetic" OFF) option(SPLASH_CMYK "include support for CMYK rasterization" OFF) option(NO_FONTCONFIG "disable support for libfontconfig" OFF) +option(SYSTEM_XPDFRC "full path for system-wide xpdfrc file" "") +if (SYSTEM_XPDFRC) + set(SYSTEM_XPDFRC_DEFINE "#define SYSTEM_XPDFRC \"${SYSTEM_XPDFRC}\"") +else () + set(SYSTEM_XPDFRC_DEFINE "/* #undef SYSTEM_XPDFRC */") +endif () +option(XPDFRC_DATADIR "directory to use for the DATADIR xpdfrc variable" "") +if (XPDFRC_DATADIR) + set(XPDFRC_DATADIR_DEFINE "#define XPDFRC_DATADIR \"${XPDFRC_DATADIR}\"") +else () + set(XPDFRC_DATADIR_DEFINE "/* #undef XPDFRC_DATADIR */") +endif () if (WIN32) option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" OFF) else () option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" ON) endif () -#--- paths -set(SYSTEM_XPDFRC "${SYSTEM_XPDFRC}" CACHE FILEPATH "full path for system-wide xpdfrc file") -set(XPDFRC_DATADIR "${XPDFRC_DATADIR}" CACHE PATH "directory to use for the DATADIR xpdfrc variable") -set(BASE14_FONT_DIR "${BASE14_FONT_DIR}" CACHE PATH "directory where the Base14 fonts are installed") - #--- check for various library functions check_function_exists(mkstemp HAVE_MKSTEMP) check_function_exists(mkstemps HAVE_MKSTEMPS) @@ -201,13 +208,11 @@ find_package(PNG) find_package(Qt6Widgets QUIET) if (Qt6Widgets_FOUND) find_package(Qt6Network) - find_package(Qt6Concurrent) find_package(Qt6PrintSupport) else () find_package(Qt5Widgets QUIET) if (Qt5Widgets_FOUND) find_package(Qt5Network) - find_package(Qt5Concurrent) find_package(Qt5PrintSupport) else () find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork) @@ -216,12 +221,12 @@ endif () if (Qt5Widgets_FOUND) message(STATUS "Qt5 found") if (XPDFWIDGET_PRINTING) - set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}") - set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Concurrent_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}") + set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}") set(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::PrintSupport) else () - set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS}") - set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Concurrent_DEFINITIONS}") + set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS}") set(QT_LIBRARIES Qt5::Widgets Qt5::Network) endif () if (XPDFWIDGET_PRINTING) @@ -243,13 +248,13 @@ if (Qt5Widgets_FOUND) elseif (Qt6Widgets_FOUND) message(STATUS "Qt6 found") if (XPDFWIDGET_PRINTING) - set(QT_INCLUDES ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6Concurrent_INCLUDE_DIRS} ${Qt6PrintSupport_INCLUDE_DIRS}) - set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS} ${Qt6Concurrent_DEFINITIONS} ${Qt6PrintSupport_DEFINITIONS}") - set(QT_LIBRARIES Qt6::Widgets Qt6::Network Qt6::Concurrent Qt6::PrintSupport) + set(QT_INCLUDES "${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6PrintSupport_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS} ${Qt6PrintSupport_DEFINITIONS}") + set(QT_LIBRARIES Qt6::Widgets Qt6::Network Qt6::PrintSupport) else () - set(QT_INCLUDES ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6Concurrent_INCLUDE_DIRS}) - set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS} ${Qt6Concurrent_DEFINITIONS}") - set(QT_LIBRARIES Qt6::Widgets Qt6::Network Qt6::Concurrent) + set(QT_INCLUDES "${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS}") + set(QT_LIBRARIES Qt6::Widgets Qt6::Network) endif () if (XPDFWIDGET_PRINTING) if (APPLE) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 index 16847b0563f..4d00f3722d6 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 @@ -1,8 +1,8 @@ -.\" Copyright 2013-2024 Glyph & Cog, LLC -.TH pdfdetach 1 "08 Feb 2024" +.\" Copyright 2013-2022 Glyph & Cog, LLC +.TH pdfdetach 1 "18 Apr 2022" .SH NAME pdfdetach \- Portable Document Format (PDF) document embedded file -extractor (version 4.05) +extractor (version 4.04) .SH SYNOPSIS .B pdfdetach [options] @@ -86,13 +86,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdfinfo software and documentation are copyright 1996-2024 Glyph & +The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat index 73e397280a4..220bb752467 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat @@ -3,8 +3,8 @@ pdfdetach(1) General Commands Manual pdfdetach(1) NAME - pdfdetach - Portable Document Format (PDF) document embedded file ex- - tractor (version 4.05) + pdfdetach - Portable Document Format (PDF) document embedded file + extractor (version 4.04) SYNOPSIS pdfdetach [options] [PDF-file] @@ -76,12 +76,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdfinfo software and documentation are copyright 1996-2024 Glyph & + The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -91,4 +89,4 @@ SEE ALSO - 08 Feb 2024 pdfdetach(1) + 18 Apr 2022 pdfdetach(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 index 7734d5cb284..6ee0226e677 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 @@ -1,8 +1,8 @@ -.\" Copyright 1999-2024 Glyph & Cog, LLC -.TH pdffonts 1 "08 Feb 2024" +.\" Copyright 1999-2022 Glyph & Cog, LLC +.TH pdffonts 1 "18 Apr 2022" .SH NAME pdffonts \- Portable Document Format (PDF) font analyzer (version -4.05) +4.04) .SH SYNOPSIS .B pdffonts [options] @@ -143,13 +143,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdffonts software and documentation are copyright 1996-2024 Glyph +The pdffonts software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat index 41ad2eabd29..77fef55fd64 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat @@ -3,7 +3,7 @@ pdffonts(1) General Commands Manual pdffonts(1) NAME - pdffonts - Portable Document Format (PDF) font analyzer (version 4.05) + pdffonts - Portable Document Format (PDF) font analyzer (version 4.04) SYNOPSIS pdffonts [options] [PDF-file] @@ -14,8 +14,8 @@ DESCRIPTION The following information is listed for each font: - name the font name, exactly as given in the PDF file (potentially in- - cluding a subset prefix) + name the font name, exactly as given in the PDF file (potentially + including a subset prefix) type the font type -- see below for details @@ -102,12 +102,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdffonts software and documentation are copyright 1996-2024 Glyph & + The pdffonts software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -117,4 +115,4 @@ SEE ALSO - 08 Feb 2024 pdffonts(1) + 18 Apr 2022 pdffonts(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 index 951b232eb16..06a9c1fc85c 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 @@ -1,8 +1,8 @@ -.\" Copyright 1998-2024 Glyph & Cog, LLC -.TH pdfimages 1 "08 Feb 2024" +.\" Copyright 1998-2022 Glyph & Cog, LLC +.TH pdfimages 1 "18 Apr 2022" .SH NAME pdfimages \- Portable Document Format (PDF) image extractor -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdfimages [options] @@ -78,11 +78,6 @@ Print a status message (to stdout) before processing each page. Don't print any messages or errors. .RB "[config file: " errQuiet ] .TP -.BI \-cfg " config-file" -Read -.I config-file -in place of ~/.xpdfrc or the system-wide config file. -.TP .B \-v Print copyright and version information. .TP @@ -107,13 +102,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdfimages software and documentation are copyright 1998-2024 Glyph +The pdfimages software and documentation are copyright 1998-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat index 25695487f83..7361a3bb11c 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat @@ -4,7 +4,7 @@ pdfimages(1) General Commands Manual pdfimages(1) NAME pdfimages - Portable Document Format (PDF) image extractor (version - 4.05) + 4.04) SYNOPSIS pdfimages [options] PDF-file image-root @@ -71,10 +71,6 @@ OPTIONS -q Don't print any messages or errors. [config file: errQuiet] - -cfg config-file - Read config-file in place of ~/.xpdfrc or the system-wide config - file. - -v Print copyright and version information. -h Print usage information. (-help and --help are equivalent.) @@ -90,19 +86,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdfimages software and documentation are copyright 1998-2024 Glyph + The pdfimages software and documentation are copyright 1998-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- fonts(1), pdfdetach(1), pdftoppm(1), pdftopng(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdfimages(1) + 18 Apr 2022 pdfimages(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 index f554e52fbc0..66f3e70bf3a 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 @@ -1,8 +1,8 @@ -.\" Copyright 1999-2024 Glyph & Cog, LLC -.TH pdfinfo 1 "08 Feb 2024" +.\" Copyright 1999-2022 Glyph & Cog, LLC +.TH pdfinfo 1 "18 Apr 2022" .SH NAME pdfinfo \- Portable Document Format (PDF) document information -extractor (version 4.05) +extractor (version 4.04) .SH SYNOPSIS .B pdfinfo [options] @@ -63,10 +63,7 @@ page size and rotation file size .RE .RS -optimized (aka linearized) (yes/no) -.RE -.RS -uses JavaScript (yes/no) +linearized (yes/no) .RE .RS PDF version @@ -106,9 +103,6 @@ the PDF file's Catalog object.) .B \-rawdates Prints the raw (undecoded) date strings, directly from the PDF file. .TP -.B \-custom -Prints any custom (non-standard) entries in the \'Info' dictionary. -.TP .BI \-enc " encoding-name" Sets the encoding to use for text output. The .I encoding\-name @@ -153,13 +147,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdfinfo software and documentation are copyright 1996-2024 Glyph & +The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat index 90682eb2903..05dbc38f18b 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat @@ -4,7 +4,7 @@ pdfinfo(1) General Commands Manual pdfinfo(1) NAME pdfinfo - Portable Document Format (PDF) document information extractor - (version 4.05) + (version 4.04) SYNOPSIS pdfinfo [options] [PDF-file] @@ -33,8 +33,7 @@ DESCRIPTION print and copy permissions (if encrypted) page size and rotation file size - optimized (aka linearized) (yes/no) - uses JavaScript (yes/no) + linearized (yes/no) PDF version metadata (only if requested) @@ -51,10 +50,10 @@ OPTIONS corresponding command line option. -f number - Specifies the first page to examine. If multiple pages are re- - quested using the "-f" and "-l" options, the size of each re- - quested page (and, optionally, the bounding boxes for each re- - quested page) are printed. Otherwise, only page one is exam- + Specifies the first page to examine. If multiple pages are + requested using the "-f" and "-l" options, the size of each + requested page (and, optionally, the bounding boxes for each + requested page) are printed. Otherwise, only page one is exam- ined. -l number @@ -70,18 +69,14 @@ OPTIONS Prints the raw (undecoded) date strings, directly from the PDF file. - -custom - Prints any custom (non-standard) entries in the 'Info' dictio- - nary. - -enc encoding-name - Sets the encoding to use for text output. The encoding-name - must be defined with the unicodeMap command (see xpdfrc(5)). + Sets the encoding to use for text output. The encoding-name + must be defined with the unicodeMap command (see xpdfrc(5)). This defaults to "Latin1" (which is a built-in encoding). [con- fig file: textEncoding] -opw password - Specify the owner password for the PDF file. Providing this + Specify the owner password for the PDF file. Providing this will bypass all security restrictions. -upw password @@ -106,19 +101,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdfinfo software and documentation are copyright 1996-2024 Glyph & + The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdffonts(1), pdfde- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdffonts(1), pdfde- tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdfinfo(1) + 18 Apr 2022 pdfinfo(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 index bead853b7ad..5129f0dd4b9 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 @@ -1,8 +1,8 @@ -.\" Copyright 1997-2024 Glyph & Cog, LLC -.TH pdftohtml 1 "08 Feb 2024" +.\" Copyright 1997-2022 Glyph & Cog, LLC +.TH pdftohtml 1 "18 Apr 2022" .SH NAME pdftohtml \- Portable Document Format (PDF) to HTML converter -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdftohtml [options] @@ -84,21 +84,12 @@ Convert AcroForm text and checkbox fields to HTML input elements. This also removes text (e.g., underscore characters) and erases background image content (e.g., lines or boxes) in the field areas. .TP -.B \-meta -Include PDF document metadata as 'meta' elements in the HTML header. -.TP .B \-table Use table mode when performing the underlying text extraction. This will generally produce better output when the PDF content is a full-page table. NB: This does not generate HTML tables; it just changes the way text is split up. .TP -.B \-overwrite -By default pdftohtml will not overwrite the specified output -directory. If the directory already exists, pdftohtml will exit with -an error. This option tells pdftohtml to instead overwrite the -existing directory. -.TP .BI \-opw " password" Specify the owner password for the PDF file. Providing this will bypass all security restrictions. @@ -147,13 +138,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftohtml software and documentation are copyright 1996-2024 Glyph +The pdftohtml software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat index d3f11b7ba0b..5ddbfa0c9fb 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat @@ -4,7 +4,7 @@ pdftohtml(1) General Commands Manual pdftohtml(1) NAME pdftohtml - Portable Document Format (PDF) to HTML converter (version - 4.05) + 4.04) SYNOPSIS pdftohtml [options] PDF-file HTML-dir @@ -59,8 +59,8 @@ OPTIONS the HTML file, rather than storing it as a separate file. -nofonts - Disable extraction of embedded fonts. By default, pdftohtml ex- - tracts TrueType and OpenType fonts. Disabling extraction can + Disable extraction of embedded fonts. By default, pdftohtml + extracts TrueType and OpenType fonts. Disabling extraction can work around problems with buggy fonts. -embedfonts @@ -70,8 +70,8 @@ OPTIONS -skipinvisible Don't draw invisible text. By default, invisible text (commonly used in OCR'ed PDF files) is drawn as transparent (alpha=0) HTML - text. This option tells pdftohtml to discard invisible text en- - tirely. + text. This option tells pdftohtml to discard invisible text + entirely. -allinvisible Treat all text as invisible. By default, regular (non-invisi- @@ -86,20 +86,11 @@ OPTIONS erases background image content (e.g., lines or boxes) in the field areas. - -meta Include PDF document metadata as 'meta' elements in the HTML - header. - - -table Use table mode when performing the underlying text extraction. - This will generally produce better output when the PDF content - is a full-page table. NB: This does not generate HTML tables; + -table Use table mode when performing the underlying text extraction. + This will generally produce better output when the PDF content + is a full-page table. NB: This does not generate HTML tables; it just changes the way text is split up. - -overwrite - By default pdftohtml will not overwrite the specified output di- - rectory. If the directory already exists, pdftohtml will exit - with an error. This option tells pdftohtml to instead overwrite - the existing directory. - -opw password Specify the owner password for the PDF file. Providing this will bypass all security restrictions. @@ -137,12 +128,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftohtml software and documentation are copyright 1996-2024 Glyph + The pdftohtml software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -152,4 +141,4 @@ SEE ALSO - 08 Feb 2024 pdftohtml(1) + 18 Apr 2022 pdftohtml(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 index 8962a16ce65..1193120a54d 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 @@ -1,8 +1,8 @@ -.\" Copyright 2017-2024 Glyph & Cog, LLC -.TH pdftopng 1 "08 Feb 2024" +.\" Copyright 2017-2022 Glyph & Cog, LLC +.TH pdftopng 1 "18 Apr 2022" .SH NAME pdftopng \- Portable Document Format (PDF) to Portable Network Graphics -(PNG) converter (version 4.05) +(PNG) converter (version 4.04) .SH SYNOPSIS .B pdftopng [options] @@ -86,11 +86,6 @@ Print a status message (to stdout) before processing each page. Don't print any messages or errors. .RB "[config file: " errQuiet ] .TP -.BI \-cfg " config-file" -Read -.I config-file -in place of ~/.xpdfrc or the system-wide config file. -.TP .B \-v Print copyright and version information. .TP @@ -115,13 +110,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftopng software and documentation are copyright 1996-2024 Glyph +The pdftopng software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat index b48d4720fc8..10a4408496f 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat @@ -4,7 +4,7 @@ pdftopng(1) General Commands Manual pdftopng(1) NAME pdftopng - Portable Document Format (PDF) to Portable Network Graphics - (PNG) converter (version 4.05) + (PNG) converter (version 4.04) SYNOPSIS pdftopng [options] PDF-file PNG-root @@ -76,10 +76,6 @@ OPTIONS -q Don't print any messages or errors. [config file: errQuiet] - -cfg config-file - Read config-file in place of ~/.xpdfrc or the system-wide config - file. - -v Print copyright and version information. -h Print usage information. (-help and --help are equivalent.) @@ -95,19 +91,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftopng software and documentation are copyright 1996-2024 Glyph & + The pdftopng software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- fonts(1), pdfdetach(1), pdftoppm(1), pdfimages(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdftopng(1) + 18 Apr 2022 pdftopng(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 index c5d981bc24b..d485b2bc48f 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 @@ -1,8 +1,8 @@ -.\" Copyright 2005-2024 Glyph & Cog, LLC -.TH pdftoppm 1 "08 Feb 2024" +.\" Copyright 2005-2022 Glyph & Cog, LLC +.TH pdftoppm 1 "18 Apr 2022" .SH NAME pdftoppm \- Portable Document Format (PDF) to Portable Pixmap (PPM) -converter (version 4.05) +converter (version 4.04) .SH SYNOPSIS .B pdftoppm [options] @@ -86,11 +86,6 @@ Print a status message (to stdout) before processing each page. Don't print any messages or errors. .RB "[config file: " errQuiet ] .TP -.BI \-cfg " config-file" -Read -.I config-file -in place of ~/.xpdfrc or the system-wide config file. -.TP .B \-v Print copyright and version information. .TP @@ -115,13 +110,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftoppm software and documentation are copyright 1996-2024 Glyph +The pdftoppm software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat index 1c395f93c38..30d012df246 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat @@ -4,7 +4,7 @@ pdftoppm(1) General Commands Manual pdftoppm(1) NAME pdftoppm - Portable Document Format (PDF) to Portable Pixmap (PPM) con- - verter (version 4.05) + verter (version 4.04) SYNOPSIS pdftoppm [options] PDF-file PPM-root @@ -75,10 +75,6 @@ OPTIONS -q Don't print any messages or errors. [config file: errQuiet] - -cfg config-file - Read config-file in place of ~/.xpdfrc or the system-wide config - file. - -v Print copyright and version information. -h Print usage information. (-help and --help are equivalent.) @@ -94,19 +90,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftoppm software and documentation are copyright 1996-2024 Glyph & + The pdftoppm software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- fonts(1), pdfdetach(1), pdftopng(1), pdfimages(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdftoppm(1) + 18 Apr 2022 pdftoppm(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 index be19dccb77e..028e983aec9 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 @@ -1,8 +1,8 @@ -.\" Copyright 1996-2024 Glyph & Cog, LLC -.TH pdftops 1 "08 Feb 2024" +.\" Copyright 1996-2022 Glyph & Cog, LLC +.TH pdftops 1 "18 Apr 2022" .SH NAME pdftops \- Portable Document Format (PDF) to PostScript converter -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdftops [options] @@ -237,13 +237,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftops software and documentation are copyright 1996-2024 Glyph & +The pdftops software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat index 904e17d1654..ed1c8b718cc 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat @@ -4,7 +4,7 @@ pdftops(1) General Commands Manual pdftops(1) NAME pdftops - Portable Document Format (PDF) to PostScript converter (ver- - sion 4.05) + sion 4.04) SYNOPSIS pdftops [options] [PDF-file [PS-file]] @@ -40,8 +40,8 @@ OPTIONS Generate Level 1 PostScript. The resulting PostScript files will be significantly larger (if they contain images), but will print on Level 1 printers. This also converts all images to - black and white. No more than one of the PostScript level op- - tions (-level1, -level1sep, -level2, -level2sep, -level3, + black and white. No more than one of the PostScript level + options (-level1, -level1sep, -level2, -level2sep, -level3, -level3sep) may be given. [config file: psLevel] -level1sep @@ -147,8 +147,8 @@ OPTIONS maller] -noshrink - Don't scale PDF pages which are larger than the paper. By de- - fault, pages larger than the paper are shrunk to fit. [config + Don't scale PDF pages which are larger than the paper. By + default, pages larger than the paper are shrunk to fit. [config file: psShrinkLarger] -nocenter @@ -162,8 +162,8 @@ OPTIONS Box is used as the page size. [config file: psUseCropBoxAsPage] -userunit - Honor the UserUnit settings on PDF pages when computing page/pa- - per size. By default, pdftops ignores UserUnit. + Honor the UserUnit settings on PDF pages when computing + page/paper size. By default, pdftops ignores UserUnit. -duplex Set the Duplex pagedevice entry in the PostScript file. This @@ -202,12 +202,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftops software and documentation are copyright 1996-2024 Glyph & + The pdftops software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -217,4 +215,4 @@ SEE ALSO - 08 Feb 2024 pdftops(1) + 18 Apr 2022 pdftops(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 index afb77de0aba..e5e7d655bda 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 @@ -1,8 +1,8 @@ -.\" Copyright 1997-2024 Glyph & Cog, LLC -.TH pdftotext 1 "08 Feb 2024" +.\" Copyright 1997-2022 Glyph & Cog, LLC +.TH pdftotext 1 "18 Apr 2022" .SH NAME pdftotext \- Portable Document Format (PDF) to text converter -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdftotext [options] @@ -202,13 +202,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftotext software and documentation are copyright 1996-2024 Glyph +The pdftotext software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat index 370a9a55dae..face2575a3f 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat @@ -4,7 +4,7 @@ pdftotext(1) General Commands Manual pdftotext(1) NAME pdftotext - Portable Document Format (PDF) to text converter (version - 4.05) + 4.04) SYNOPSIS pdftotext [options] [PDF-file [text-file]] @@ -55,8 +55,8 @@ OPTIONS -table Table mode is similar to physical layout mode, but optimized for tabular data, with the goal of keeping rows and columns aligned (at the expense of inserting extra whitespace). If the -fixed - option is given, character spacing within each line will be de- - termined by the specified character pitch. + option is given, character spacing within each line will be + determined by the specified character pitch. -lineprinter Line printer mode uses a strict fixed-character-pitch and @@ -168,12 +168,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftotext software and documentation are copyright 1996-2024 Glyph + The pdftotext software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -183,4 +181,4 @@ SEE ALSO - 08 Feb 2024 pdftotext(1) + 18 Apr 2022 pdftotext(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 index 3c71010129a..2eaa95af69b 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 @@ -1,7 +1,7 @@ -.\" Copyright 1996-2024 Glyph & Cog, LLC -.TH xpdf 1 "08 Feb 2024" +.\" Copyright 1996-2022 Glyph & Cog, LLC +.TH xpdf 1 "18 Apr 2022" .SH NAME -xpdf \- Portable Document Format (PDF) file viewer (version 4.05) +xpdf \- Portable Document Format (PDF) file viewer (version 4.04) .SH SYNOPSIS .B xpdf [options] @@ -146,7 +146,7 @@ password. Open xpdf in full-screen mode, useful for presentations. .TP .BI \-remote " remote-name" -Start Xpdf in remote server mode. See the REMOTE SERVER MODE section. +Start Xpdf in remote server mode. See the REMOVE SERVER MODE section. .TP .BI \-display " display" Set the X display (only available with X11). @@ -221,9 +221,8 @@ Find the next occurrence of the search string. Find the previous occurrence of the search string. .TP .B "find settings button" -Display the current find settings: case insensitive, case sensitive, -smart case (case sensitive only if the search string contains -uppercase characters), find whole words. +Display the current find settings: case sensitive (on/off), find whole +words (on/off). .PP .SS Menu bar The menu bar is above the toolbar. The menu items should be @@ -565,10 +564,6 @@ Switch to horizontal continuous view mode. Set linear selection mode. In this mode, the selection follows text. Non-text regions cannot be selected. .TP -.B loadSession -Load the session from the session save file. The path for the session file is specified with the sessionFile setting (see -.BR xpdfrc (5)). -.TP .BI loadTabState Load the tab state file (which was written via the saveTabState command), and restore the tabs listed in that file. The path for the @@ -735,13 +730,6 @@ Save PDF via a file requester. .B saveImage Open the \'save image' dialog. .TP -.B saveSession -Save the current session, consisting of all open windows and tabs, to -the session save file. This file can be loaded later with the -loadSession command. The path for the session file is specified with -the sessionFile setting (see -.BR xpdfrc (5)). -.TP .BI saveTabState Save a list of all tabs open in this window to the tab state file. For each tab, this writes the PDF file name and page number (on @@ -960,7 +948,7 @@ Error related to PDF permissions. 99 Other error. .SH AUTHOR -The xpdf software and documentation are copyright 1996-2024 Glyph & +The xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR pdftops (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat index 374552235ca..ba20911962d 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat @@ -3,7 +3,7 @@ xpdf(1) General Commands Manual xpdf(1) NAME - xpdf - Portable Document Format (PDF) file viewer (version 4.05) + xpdf - Portable Document Format (PDF) file viewer (version 4.04) SYNOPSIS xpdf [options] [PDF-file [:page | +dest]] ... @@ -45,12 +45,12 @@ CONFIGURATION FILE Xpdf reads a configuration file at startup. It first tries to find the user's private config file, ~/.xpdfrc. If that doesn't exist, it looks for a system-wide config file, typically /etc/xpdfrc (but this location - can be changed when xpdf is built). See the xpdfrc(5) man page for de- - tails. + can be changed when xpdf is built). See the xpdfrc(5) man page for + details. OPTIONS - The following command line options are available. All command line op- - tions must come before any PDF files to be opened. + The following command line options are available. All command line + options must come before any PDF files to be opened. Many of the options can be set with configuration file commands. These are listed in square brackets with the description of the corresponding @@ -124,7 +124,7 @@ OPTIONS Open xpdf in full-screen mode, useful for presentations. -remote remote-name - Start Xpdf in remote server mode. See the REMOTE SERVER MODE + Start Xpdf in remote server mode. See the REMOVE SERVER MODE section. -display display @@ -194,54 +194,53 @@ CONTROLS Find the previous occurrence of the search string. find settings button - Display the current find settings: case insensitive, case sensi- - tive, smart case (case sensitive only if the search string con- - tains uppercase characters), find whole words. + Display the current find settings: case sensitive (on/off), find + whole words (on/off). Menu bar - The menu bar is above the toolbar. The menu items should be self-ex- - planatory. + The menu bar is above the toolbar. The menu items should be self- + explanatory. Tab list The tab list is on the left, just below the toolbar. It lists all open tabs. Outline/layers/attachments pane - This pane is on the left, below the tab list. The popup allows you to + This pane is on the left, below the tab list. The popup allows you to select from outline, layers, or attachments. - The outline is a tree-like structure of bookmarks that allows moving + The outline is a tree-like structure of bookmarks that allows moving within the PDF file. Not all PDF files have outlines. - Layers (a.k.a. optional content) allow parts of the PDF content to be + Layers (a.k.a. optional content) allow parts of the PDF content to be shown or hidden. Not all PDF files have layers. - Attachments are other files embedded within the PDF file. There is a - 'save' button for each attached file. Not all PDF files have attach- + Attachments are other files embedded within the PDF file. There is a + 'save' button for each attached file. Not all PDF files have attach- ments. Text selection - In block selection mode, dragging the mouse with the left button held + In block selection mode, dragging the mouse with the left button held down will highlight an arbitrary rectangle. Shift-clicking will extend the selection. - In linear selection mode, dragging with the left button will highlight - text in reading order. Double-clicking or triple-clicking will select - a word or a line, respectively. Shift-clicking will extend the selec- + In linear selection mode, dragging with the left button will highlight + text in reading order. Double-clicking or triple-clicking will select + a word or a line, respectively. Shift-clicking will extend the selec- tion. - Selected text can be copied to the clipboard (with the edit/copy menu + Selected text can be copied to the clipboard (with the edit/copy menu item). On X11, selected text will be available in the X selection buf- fer. Links - When the mouse is over a hyperlink, the link target will be shown in a + When the mouse is over a hyperlink, the link target will be shown in a popup near the bottom of the window. Clicking on a hyperlink will jump to the link's destination. A link to - another PDF document will make xpdf load that document. A 'launch' - link to an executable program will display a dialog, and if you click - 'ok', execute the program. URL links are opened in a system-dependent + another PDF document will make xpdf load that document. A 'launch' + link to an executable program will display a dialog, and if you click + 'ok', execute the program. URL links are opened in a system-dependent way. (On UNIX, Qt uses the $BROWSER environment variable.) Mouse bindings @@ -251,19 +250,19 @@ CONTROLS Dragging the mouse with the middle button held down pans the window. - The right mouse button opens a popup menu (see popupMenuCmd in + The right mouse button opens a popup menu (see popupMenuCmd in xpdfrc(5)). Key bindings - This section lists the default key bindings. Bindings can be changed + This section lists the default key bindings. Bindings can be changed using the config file (see xpdfrc(5)). control-o Open a new PDF file via a file requester. control-r - Reload the current PDF file. Note that Xpdf will reload the - file automatically (on a page change or redraw) if it has + Reload the current PDF file. Note that Xpdf will reload the + file automatically (on a page change or redraw) if it has changed since it was last loaded. control-f @@ -297,8 +296,8 @@ CONTROLS Open a new window. control-w - Close the current tab. Closes the window if this was the last - open tab. Quits the application if this was the last open win- + Close the current tab. Closes the window if this was the last + open tab. Quits the application if this was the last open win- dow. control-l @@ -333,11 +332,11 @@ CONTROLS Go to the last page. or - Scroll down on the current page; if already at bottom, move to + Scroll down on the current page; if already at bottom, move to next page. control- or control- - Go to the next page. If is active, this maintains + Go to the next page. If is active, this maintains the relative position on the page. @@ -345,7 +344,7 @@ CONTROLS ous page. control- or control- - Go to the previous page. If is active, this main- + Go to the previous page. If is active, this main- tains the relative position on the page. Exit full-screen mode. @@ -359,26 +358,26 @@ CONTROLS w Set the zoom factor to 'width' (fit page width to window). Full-screen mode - Xpdf can be placed into full-screen mode via the -fullscreen command - line option, the 'full screen' menu item, or a binding to the + Xpdf can be placed into full-screen mode via the -fullscreen command + line option, the 'full screen' menu item, or a binding to the fullScreenMode or toggleFullScreenMode command. - Entering full-screen mode automatically switches to single-page view + Entering full-screen mode automatically switches to single-page view mode and to the fit-page zoom factor. - Full-screen mode can be exited via the default key binding, or + Full-screen mode can be exited via the default key binding, or via a binding to the windowMode or toggleFullScreenModecommand. COMMANDS Xpdf's key and mouse bindings are user-configurable, using the bind and - unbind commands in the config file (see xpdfrc(5)). The bind command - allows you to bind a key or mouse button to a sequence of one or more + unbind commands in the config file (see xpdfrc(5)). The bind command + allows you to bind a key or mouse button to a sequence of one or more commands. - In commands that take arguments (inside parentheses), special charac- - ters (namely '(', ')', ',', and '\x01') can be escaped by preceding - them with a '\x01' character. This is mostly useful in things like - scripts that need to be able to open arbitrary PDF files, using the + In commands that take arguments (inside parentheses), special charac- + ters (namely '(', ')', ',', and '\x01') can be escaped by preceding + them with a '\x01' character. This is mostly useful in things like + scripts that need to be able to open arbitrary PDF files, using the 'openFile' command. The following commands are supported: @@ -394,11 +393,11 @@ COMMANDS Check that file is open in the current tab, and open it if not. checkOpenFileAtDest(file,dest) - Check that file is open in the current tab, and open it if not. + Check that file is open in the current tab, and open it if not. In either case go to the specified named destination. checkOpenFileAtPage(file,page) - Check that file is open in the current tab, and open it if not. + Check that file is open in the current tab, and open it if not. In either case go to the specified page. closeSidebar @@ -426,7 +425,7 @@ COMMANDS copy Copy selected text to the clipboard. copyLinkTarget - Copy the target of the link under the mouse cursor to the clip- + Copy the target of the link under the mouse cursor to the clip- board. endPan End a pan operation. @@ -456,30 +455,30 @@ COMMANDS Set keyboard focus to the page number text box. followLink - Follow a hyperlink (does nothing if the mouse is not over a + Follow a hyperlink (does nothing if the mouse is not over a link). followLinkInNewTab Follow a hyperlink, opening PDF files in a new tab (does nothing - if the mouse is not over a link). For links to non-PDF files, + if the mouse is not over a link). For links to non-PDF files, this command is identical to followLink. followLinkInNewTabNoSel - Same as followLinkInNewTab, but does nothing if there is a non- + Same as followLinkInNewTab, but does nothing if there is a non- empty selection. (This is useful as a mouse button binding.) followLinkInNewWin - Follow a hyperlink, opening PDF files in a new window (does - nothing if the mouse is not over a link). For links to non-PDF + Follow a hyperlink, opening PDF files in a new window (does + nothing if the mouse is not over a link). For links to non-PDF files, this command is identical to followLink. followLinkInNewWinNoSel - Same as followLinkInNewWin, but does nothing if there is a non- + Same as followLinkInNewWin, but does nothing if there is a non- empty selection. (This is useful as a mouse button binding.) followLinkNoSel - Same as followLink, but does nothing if there is a non-empty se- - lection. (This is useful as a mouse button binding.) + Same as followLink, but does nothing if there is a non-empty + selection. (This is useful as a mouse button binding.) fullScreenMode Go to full-screen mode. @@ -511,18 +510,13 @@ COMMANDS Switch to horizontal continuous view mode. linearSelectMode - Set linear selection mode. In this mode, the selection follows + Set linear selection mode. In this mode, the selection follows text. Non-text regions cannot be selected. - loadSession - Load the session from the session save file. The path for the - session file is specified with the sessionFile setting (see - xpdfrc(5)). - loadTabState - Load the tab state file (which was written via the saveTabState - command), and restore the tabs listed in that file. The path - for the tab state file is specified with the tabStateFile set- + Load the tab state file (which was written via the saveTabState + command), and restore the tabs listed in that file. The path + for the tab state file is specified with the tabStateFile set- ting (see xpdfrc(5)). newTab Open an empty new tab. @@ -549,26 +543,26 @@ COMMANDS openFile2(file,page,dest,passwd,location) Open the specified file. If dest is not empty, go to the speci- - fied named destination. Else, if page is not empty, go to the - specified page number. If password is not empty, it is used as - the PDF password. If location is "win", open the file in a new - window; if it is "tab", open in a new tab; if it is "check", - open in the current tab, but only if the specified PDF file - isn't already open; else open in the current tab. Any/all of + fied named destination. Else, if page is not empty, go to the + specified page number. If password is not empty, it is used as + the PDF password. If location is "win", open the file in a new + window; if it is "tab", open in a new tab; if it is "check", + open in the current tab, but only if the specified PDF file + isn't already open; else open in the current tab. Any/all of the arguments, other than file, can be empty strings. For exam- ple: openFile2(test.pdf,7,,,tab) openFileAtDest(file,dest) - Open the specified file in the current tab at the specified + Open the specified file in the current tab at the specified named destination. openFileAtDestIn(file,dest,location) - Open the specified file at the specified named destination. Lo- - cation must be "win" for a new window or "tab" for a new tab. + Open the specified file at the specified named destination. + Location must be "win" for a new window or "tab" for a new tab. openFileAtPage(file,page) - Open the specified file in the current tab at the specified + Open the specified file in the current tab at the specified page. openFileAtPageIn(file,page,location) @@ -576,23 +570,23 @@ COMMANDS "win" for a new window or "tab" for a new tab. openFileIn(file,location) - Open the specified file. Location must be "win" for a new win- + Open the specified file. Location must be "win" for a new win- dow or "tab" for a new tab. openIn(location) - Open a PDF file, using the open dialog. Location must be "win" + Open a PDF file, using the open dialog. Location must be "win" for a new window or "tab" for a new tab. openSidebar Open the sidebar. openSidebarMoveResizeWin - Open the sidebar, resizing the window so that the document size + Open the sidebar, resizing the window so that the document size doesn't change, and moving the window so that the document stays in the same place on the screen. openSidebarResizeWin - Open the sidebar, resizing the window so that the document size + Open the sidebar, resizing the window so that the document size doesn't change. pageDown @@ -607,7 +601,7 @@ COMMANDS Go to the previous page. prevPageNoScroll - Go to the previous page, with the current relative scroll posi- + Go to the previous page, with the current relative scroll posi- tion. prevTab @@ -628,7 +622,7 @@ COMMANDS Rotate the page 90 degrees clockwise. run(external-command-string) - Run an external command. The following escapes are allowed in + Run an external command. The following escapes are allowed in the command string: %f => PDF file name (or an empty string if no @@ -653,14 +647,14 @@ COMMANDS %k => y coordinate of the mouse pointer %% => % - The external command string will often contain spaces, so the + The external command string will often contain spaces, so the whole command must be quoted in the xpdfrc file: bind x "run(ls -l)" The command string may not be run through a shell. It is recom- - mended to keep the command simple, so that it doesn't depend on - specific shell functionality. For complex things, you can have + mended to keep the command simple, so that it doesn't depend on + specific shell functionality. For complex things, you can have the command string run a shell script. saveAs Save PDF via a file requester. @@ -668,12 +662,6 @@ COMMANDS saveImage Open the 'save image' dialog. - saveSession - Save the current session, consisting of all open windows and - tabs, to the session save file. This file can be loaded later - with the loadSession command. The path for the session file is - specified with the sessionFile setting (see xpdfrc(5)). - saveTabState Save a list of all tabs open in this window to the tab state file. For each tab, this writes the PDF file name and page num- @@ -870,7 +858,7 @@ EXIT CODES 99 Other error. AUTHOR - The xpdf software and documentation are copyright 1996-2024 Glyph & + The xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -880,4 +868,4 @@ SEE ALSO - 08 Feb 2024 xpdf(1) + 18 Apr 2022 xpdf(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 index ad089b2a938..1c47e2ebb29 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 @@ -1,7 +1,7 @@ -.\" Copyright 2002-2024 Glyph & Cog, LLC -.TH xpdfrc 5 "08 Feb 2024" +.\" Copyright 2002-2022 Glyph & Cog, LLC +.TH xpdfrc 5 "18 Apr 202" .SH NAME -xpdfrc \- configuration file for Xpdf tools (version 4.05) +xpdfrc \- configuration file for Xpdf tools (version 4.04) .SH DESCRIPTION All of the Xpdf tools read a single configuration file. .PP @@ -448,12 +448,6 @@ information in TrueType fonts (16-bit only), if avaiable, to override the PDF ToUnicode maps. Otherwise, the ToUnicode maps are always used when present. This defaults to "no". .TP -.BI ignoreWrongSizeToUnicode " yes | no" -If set to "yes", Xpdf will ignore any ToUnicode CMaps that don't match -the font type (8-bit vs 16-bit). The PDF spec requires ToUnicode -CMaps match, and Adobe appears to ignore CMaps that don't match. This -defaults to "no" (for backward compatibility). -.TP .BI dropFont " font-name" Drop all text drawn in the specified font. To drop text drawn in unnamed fonts, use: @@ -463,12 +457,6 @@ unnamed fonts, use: .fi There can be any number of dropFont commands. -.TP -.BI separateRotatedText " yes | no" -If set to "no", pdftotext will attempt to place rotated text into the -"correct" location in the output. If set to "yes", when using reading -order mode, pdftotext will append rotated text to the end, after -unrotated text. This defaults to "no". .SH RASTERIZER SETTINGS .TP .BR enableFreeType " yes | no" @@ -581,17 +569,6 @@ be chosen such that exactly one page will fit in the window at this zoom factor (which must be a percentage). The default value is based on the screen resolution. .TP -.BI zoomScaleFactor " \fIratio\fR | actual" -Zoom percentages will be scaled by this factor. By default, 100% zoom -corresponds to 72 dpi. Setting zoomScaleFactor to 1.5 will make 100% -zoom 1.5x larger, i.e., 108dpi. If this is set to \'actual', the zoom -scale factor will be computed based on the screen resolution. The -default value is 1.0. -.TP -.BI zoomValues " zoom1 zoom2 zoom3 ..." -Sets the list of zoom values (percentages) displayed in the zoom combo box. -The default list is: 25 50 75 100 110 125 150 175 200 300 400 600 800. -.TP .BR initialDisplayMode " single | continuous | sideBySideSingle | sideBySideContinuous | horizontalContinuous" Sets the initial display mode. The default setting is "continuous". .TP @@ -661,12 +638,6 @@ pages. This defaults to 10. Set the number of worker threads to be used by xpdf when rasterizing pages. This defaults to 1. .TP -.BI allowLinksToChangeZoom " yes | no" -PDF links, including outline items, can include a new zoom level. If -this setting is "yes", Xpdf changes the zoom when links are clicked; -if "no", Xpdf moves to the destination but does not change the zoom. -This defaults to "yes". -.TP .BI launchCommand " command" Sets the command executed when you click on a "launch"-type link. The intent is for the command to be a program/script which determines the @@ -769,20 +740,7 @@ want to create new key bindings for multiple contexts). Sets the file used by the loadTabState and saveTabState commands (see the .BR xpdf (1) -man page for more information). The default path is ~/.xpdf.tabstate. -.TP -.BI sessionFile " path" -Sets the file used by the saveSession and loadSession commands (see -the -.BR xpdf (1) -man page for more information). The default path is ~/.xpdf.session. -When xpdf automatically saves the session via a session manager, it -appends ".managed" to the path. -.TP -.BI saveSessionOnQuit " yes | no" -If set to "yes", xpdf will automatically save the current session -(equivalent to the saveSession command) when quitting (via the menu or -a key binding). The default value is "yes". +man page for more information). .SH MISCELLANEOUS SETTINGS .TP .BI drawAnnotations " yes | no" @@ -879,7 +837,7 @@ Depending on build options, it may be placed elsewhere. This is the user's configuration file. If it exists, it will be read in place of the system-wide file. .SH AUTHOR -The Xpdf software and documentation are copyright 1996-2024 Glyph & +The Xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat index 1fccf310325..c38791eaa28 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat @@ -3,7 +3,7 @@ xpdfrc(5) File Formats Manual xpdfrc(5) NAME - xpdfrc - configuration file for Xpdf tools (version 4.05) + xpdfrc - configuration file for Xpdf tools (version 4.04) DESCRIPTION All of the Xpdf tools read a single configuration file. @@ -18,8 +18,8 @@ DESCRIPTION (pdftotext.exe, xpdf.exe, etc.) The xpdfrc file consists of a series of configuration options, one per - line. Blank lines and lines starting with a '#' (comments) are ig- - nored. + line. Blank lines and lines starting with a '#' (comments) are + ignored. Arguments can be single-quoted or double-quoted, e.g., for file names that contain spaces ("aaa bbb", 'aaa bbb'). This quoting does not pro- @@ -49,8 +49,8 @@ INCLUDE FILES GENERAL FONT CONFIGURATION fontFile PDF-font-name font-file Maps a PDF font, PDF-font-name, to a font for display or Post- - Script output. The font file, font-file, can be any type al- - lowed in a PDF file. This command can be used for 8-bit or + Script output. The font file, font-file, can be any type + allowed in a PDF file. This command can be used for 8-bit or 16-bit (CID) fonts. fontDir dir @@ -80,8 +80,8 @@ POSTSCRIPT FONT CONFIGURATION When the 8-bit font PDF-font-name is used (without embedding) in a PDF file, it will be translated to the PostScript font PS-font-name, which is assumed to be resident in the printer. - Typically, PDF-font-name and PS-font-name are the same. By de- - fault, only the Base-14 fonts are assumed to be resident. + Typically, PDF-font-name and PS-font-name are the same. By + default, only the Base-14 fonts are assumed to be resident. psResidentFont16 PDF-font-name wMode PS-font-name encoding When the 16-bit (CID) font PDF-font-name with writing mode wMode @@ -140,8 +140,8 @@ POSTSCRIPT CONTROL gers are the coordinates of the lower-left and upper-right cor- ners of the imageable region, specified in points (with the ori- gin being the lower-left corner of the paper). This defaults to - the full paper size; the psPaperSize option will reset the im- - ageable area coordinates. + the full paper size; the psPaperSize option will reset the + imageable area coordinates. psCrop yes | no If set to "yes", PostScript output is cropped to the CropBox @@ -166,8 +166,8 @@ POSTSCRIPT CONTROL psCenter yes | no If set to yes, PDF pages smaller than the PostScript imageable area (after any scaling) are centered in the imageable area. - Otherwise, they are aligned at the lower-left corner of the im- - ageable area. This defaults to "yes". + Otherwise, they are aligned at the lower-left corner of the + imageable area. This defaults to "yes". psDuplex yes | no If set to "yes", the generated PostScript will set the "Duplex" @@ -187,9 +187,9 @@ POSTSCRIPT CONTROL of a long document. This defaults to "no". psOPI yes | no - If set to "yes", generates PostScript OPI comments for all im- - ages and forms which have OPI information. This option is only - available if the Xpdf tools were compiled with OPI support. + If set to "yes", generates PostScript OPI comments for all + images and forms which have OPI information. This option is + only available if the Xpdf tools were compiled with OPI support. This defaults to "no". psASCIIHex yes | no @@ -237,8 +237,8 @@ POSTSCRIPT CONTROL set to "yes", rasterization is disabled: pages will never be rasterized, even if they contain transparency. This will likely result in incorrect output for PDF files that use transparency, - and a warning message to that effect will be printed. This de- - faults to "no". + and a warning message to that effect will be printed. This + defaults to "no". fontDir dir See the description above, in the DISPLAY FONTS section. @@ -251,8 +251,8 @@ TEXT CONTROL AND CHARACTER MAPPING above). This defaults to "Latin1". textEOL unix | dos | mac - Sets the end-of-line convention to use for text output. The op- - tions are: + Sets the end-of-line convention to use for text output. The + options are: unix = LF dos = CR+LF @@ -269,8 +269,8 @@ TEXT CONTROL AND CHARACTER MAPPING textKeepTinyChars yes | no If set to "yes", text extraction will keep all characters. If set to "no", text extraction will discard tiny (smaller than 3 - point) characters after the first 50000 per page, avoiding ex- - tremely slow run times for PDF files that use special fonts to + point) characters after the first 50000 per page, avoiding + extremely slow run times for PDF files that use special fonts to do shading or cross-hatching. This defaults to "yes". nameToUnicode map-file @@ -312,9 +312,9 @@ TEXT CONTROL AND CHARACTER MAPPING in-hex out-hex1 out-hex2 ... The in-hex field is an input (incorrect) Unicode index, and the - rest of the fields are one or more output (correct) Unicode in- - dexes. Each occurrence of in-hex will be converted to the spec- - ified output sequence. + rest of the fields are one or more output (correct) Unicode + indexes. Each occurrence of in-hex will be converted to the + specified output sequence. unicodeRemapping remap-file Remap Unicode characters when doing text extraction. This spec- @@ -344,8 +344,8 @@ TEXT CONTROL AND CHARACTER MAPPING The in-start-hex and in-end-hex fields (or the single in-hex field) specify the Unicode range. The out-start-hex field (or the out-hex field) specifies the start of the output encoding - range. The length of the out-start-hex (or out-hex) string de- - termines the length of the output characters (e.g., UTF-8 uses + range. The length of the out-start-hex (or out-hex) string + determines the length of the output characters (e.g., UTF-8 uses different numbers of bytes to represent characters in different ranges). Entries must be given in increasing Unicode order. Only one file is allowed per encoding; the last specified file @@ -354,8 +354,8 @@ TEXT CONTROL AND CHARACTER MAPPING cMapDir registry-ordering dir Specifies a search directory, dir, for CMaps for the reg- - istry-ordering character collection. There can be multiple di- - rectories for a particular collection. There are no default + istry-ordering character collection. There can be multiple + directories for a particular collection. There are no default CMap directories. toUnicodeDir dir @@ -364,16 +364,16 @@ TEXT CONTROL AND CHARACTER MAPPING ToUnicode directories. mapNumericCharNames yes | no - If set to "yes", the Xpdf tools will attempt to map various nu- - meric character names sometimes used in font subsets. In some + If set to "yes", the Xpdf tools will attempt to map various + numeric character names sometimes used in font subsets. In some cases this leads to usable text, and in other cases it leads to gibberish -- there is no way for Xpdf to tell. This defaults to "yes". mapUnknownCharNames yes | no If set to "yes", and mapNumericCharNames is set to "no", the - Xpdf tools will apply a simple pass-through mapping (Unicode in- - dex = character code) for all unrecognized glyph names. (For + Xpdf tools will apply a simple pass-through mapping (Unicode + index = character code) for all unrecognized glyph names. (For CID fonts, setting mapNumericCharNames to "no" is unnecessary.) In some cases, this leads to usable text, and in other cases it leads to gibberish -- there is no way for Xpdf to tell. This @@ -395,13 +395,6 @@ TEXT CONTROL AND CHARACTER MAPPING override the PDF ToUnicode maps. Otherwise, the ToUnicode maps are always used when present. This defaults to "no". - ignoreWrongSizeToUnicode yes | no - If set to "yes", Xpdf will ignore any ToUnicode CMaps that don't - match the font type (8-bit vs 16-bit). The PDF spec requires - ToUnicode CMaps match, and Adobe appears to ignore CMaps that - don't match. This defaults to "no" (for backward compatibil- - ity). - dropFont font-name Drop all text drawn in the specified font. To drop text drawn in unnamed fonts, use: @@ -410,141 +403,123 @@ TEXT CONTROL AND CHARACTER MAPPING There can be any number of dropFont commands. - separateRotatedText yes | no - If set to "no", pdftotext will attempt to place rotated text - into the "correct" location in the output. If set to "yes", when - using reading order mode, pdftotext will append rotated text to - the end, after unrotated text. This defaults to "no". - RASTERIZER SETTINGS enableFreeType yes | no - Enables or disables use of FreeType (a TrueType / Type 1 font + Enables or disables use of FreeType (a TrueType / Type 1 font rasterizer). This is only relevant if the Xpdf tools were built with FreeType support. ("enableFreeType" replaces the old "freetypeControl" option.) This option defaults to "yes". disableFreeTypeHinting yes | no - If this is set to "yes", FreeType hinting will be forced off. + If this is set to "yes", FreeType hinting will be forced off. This option defaults to "no". antialias yes | no - Enables or disables font anti-aliasing in the PDF rasterizer. + Enables or disables font anti-aliasing in the PDF rasterizer. This option affects all font rasterizers. ("antialias" replaces the anti-aliasing control provided by the old "t1libControl" and "freetypeControl" options.) This default to "yes". vectorAntialias yes | no - Enables or disables anti-aliasing of vector graphics in the PDF + Enables or disables anti-aliasing of vector graphics in the PDF rasterizer. This defaults to "yes". imageMaskAntialias yes | no - Enables or disables anti-aliasing of image masks (when downsam- - pling or upsampling) in the PDF rasterizer. This defaults to + Enables or disables anti-aliasing of image masks (when downsam- + pling or upsampling) in the PDF rasterizer. This defaults to "yes". antialiasPrinting yes | no - If this is "yes", bitmaps sent to the printer will be an- - tialiased (according to the "antialias" and "vectorAntialias" - settings). If this is "no", printed bitmaps will not be an- - tialiased. This defaults to "no". + If this is "yes", bitmaps sent to the printer will be + antialiased (according to the "antialias" and "vectorAntialias" + settings). If this is "no", printed bitmaps will not be + antialiased. This defaults to "no". strokeAdjust yes | no | cad - Sets the stroke adjustment mode. If set to "no", no stroke ad- - justment will be done. If set to "yes", normal stroke adjust- - ment will be done: horizontal and vertical lines will be moved - by up to half a pixel to make them look cleaner when vector + Sets the stroke adjustment mode. If set to "no", no stroke + adjustment will be done. If set to "yes", normal stroke adjust- + ment will be done: horizontal and vertical lines will be moved + by up to half a pixel to make them look cleaner when vector anti-aliasing is enabled. If set to "cad", a slightly different stroke adjustment algorithm will be used to ensure that lines of the same original width will always have the same adjusted width - (at the expense of allowing gaps and overlaps between adjacent + (at the expense of allowing gaps and overlaps between adjacent lines). This defaults to "yes". forceAccurateTiling yes | no - If this is set to "yes", the TilingType is forced to 2 (no dis- - tortion) for all tiling patterns, regardless of the setting in + If this is set to "yes", the TilingType is forced to 2 (no dis- + tortion) for all tiling patterns, regardless of the setting in the pattern dictionary. This defaults to "no". screenType dispersed | clustered | stochasticClustered - Sets the halftone screen type, which will be used when generat- - ing a monochrome (1-bit) bitmap. The three options are dis- - persed-dot dithering, clustered-dot dithering (with a round dot - and 45-degree screen angle), and stochastic clustered-dot - dithering. By default, "stochasticClustered" is used for reso- + Sets the halftone screen type, which will be used when generat- + ing a monochrome (1-bit) bitmap. The three options are dis- + persed-dot dithering, clustered-dot dithering (with a round dot + and 45-degree screen angle), and stochastic clustered-dot + dithering. By default, "stochasticClustered" is used for reso- lutions of 300 dpi and higher, and "dispersed" is used for reso- lutions lower then 300 dpi. screenSize integer - Sets the size of the (square) halftone screen threshold matrix. - By default, this is 4 for dispersed-dot dithering, 10 for clus- - tered-dot dithering, and 100 for stochastic clustered-dot + Sets the size of the (square) halftone screen threshold matrix. + By default, this is 4 for dispersed-dot dithering, 10 for clus- + tered-dot dithering, and 100 for stochastic clustered-dot dithering. screenDotRadius integer - Sets the halftone screen dot radius. This is only used when - screenType is set to stochasticClustered, and it defaults to 2. - In clustered-dot mode, the dot radius is half of the screen + Sets the halftone screen dot radius. This is only used when + screenType is set to stochasticClustered, and it defaults to 2. + In clustered-dot mode, the dot radius is half of the screen size. Dispersed-dot dithering doesn't have a dot radius. screenGamma float Sets the halftone screen gamma correction parameter. Gamma val- - ues greater than 1 make the output brighter; gamma values less + ues greater than 1 make the output brighter; gamma values less than 1 make it darker. The default value is 1. screenBlackThreshold float - When halftoning, all values below this threshold are forced to + When halftoning, all values below this threshold are forced to solid black. This parameter is a floating point value between 0 (black) and 1 (white). The default value is 0. screenWhiteThreshold float - When halftoning, all values above this threshold are forced to + When halftoning, all values above this threshold are forced to solid white. This parameter is a floating point value between 0 (black) and 1 (white). The default value is 1. minLineWidth float - Set the minimum line width, in device pixels. This affects the - rasterizer only, not the PostScript converter (except when it - uses rasterization to handle transparency). The default value + Set the minimum line width, in device pixels. This affects the + rasterizer only, not the PostScript converter (except when it + uses rasterization to handle transparency). The default value is 0 (no minimum). enablePathSimplification yes | no - If set to "yes", simplify paths by removing points where it - won't make a significant difference to the shape. The default + If set to "yes", simplify paths by removing points where it + won't make a significant difference to the shape. The default value is "no". overprintPreview yes | no If set to "yes", generate overprint preview output, honoring the - OP/op/OPM settings in the PDF file. Ignored for non-CMYK out- + OP/op/OPM settings in the PDF file. Ignored for non-CMYK out- put. The default value is "no". VIEWER SETTINGS These settings only apply to the Xpdf GUI PDF viewer. initialZoom percentage | page | width - Sets the initial zoom factor. A number specifies a zoom per- - centage, where 100 means 72 dpi. You may also specify 'page', - to fit the page to the window size, or 'width', to fit the page + Sets the initial zoom factor. A number specifies a zoom per- + centage, where 100 means 72 dpi. You may also specify 'page', + to fit the page to the window size, or 'width', to fit the page width to the window width. defaultFitZoom percentage If xpdf is started with fit-page or fit-width zoom and no window - geometry, it will calculate a desired window size based on the - PDF page size and this defaultFitZoom value. I.e., the window - size will be chosen such that exactly one page will fit in the - window at this zoom factor (which must be a percentage). The + geometry, it will calculate a desired window size based on the + PDF page size and this defaultFitZoom value. I.e., the window + size will be chosen such that exactly one page will fit in the + window at this zoom factor (which must be a percentage). The default value is based on the screen resolution. - zoomScaleFactor ratio | actual - Zoom percentages will be scaled by this factor. By default, - 100% zoom corresponds to 72 dpi. Setting zoomScaleFactor to 1.5 - will make 100% zoom 1.5x larger, i.e., 108dpi. If this is set - to 'actual', the zoom scale factor will be computed based on the - screen resolution. The default value is 1.0. - - zoomValues zoom1 zoom2 zoom3 ... - Sets the list of zoom values (percentages) displayed in the zoom - combo box. The default list is: 25 50 75 100 110 125 150 175 - 200 300 400 600 800. - initialDisplayMode single | continuous | sideBySideSingle | sideBySide- Continuous | horizontalContinuous Sets the initial display mode. The default setting is "continu- @@ -555,23 +530,23 @@ VIEWER SETTINGS "no", xpdf opens with the toolbar hidden. The default is "yes". initialSidebarState yes | no - If set to "yes", xpdf opens with the sidebar (tabs, outline, - etc.) visible. If set to "no", xpdf opens with the sidebar + If set to "yes", xpdf opens with the sidebar (tabs, outline, + etc.) visible. If set to "no", xpdf opens with the sidebar collapsed. The default is "yes". initialSidebarWidth width - Sets the initial sidebar width, in pixels. This is only rele- - vant if initialSidebarState is "yes". The default value is + Sets the initial sidebar width, in pixels. This is only rele- + vant if initialSidebarState is "yes". The default value is zero, which tells xpdf to use an internal default size. initialSelectMode block | linear - Sets the initial selection mode. The default setting is "lin- + Sets the initial selection mode. The default setting is "lin- ear". paperColor color Set the "paper color", i.e., the background of the page display. - The color can be #RRGGBB (hexadecimal) or a named color. This - option will not work well with PDF files that do things like + The color can be #RRGGBB (hexadecimal) or a named color. This + option will not work well with PDF files that do things like filling in white behind the text. matteColor color @@ -580,7 +555,7 @@ VIEWER SETTINGS a named color. fullScreenMatteColor color - Set the matte color for full-screen mode. The color can be + Set the matte color for full-screen mode. The color can be #RRGGBB (hexadecimal) or a named color. selectionColor color @@ -588,14 +563,14 @@ VIEWER SETTINGS or a named color. reverseVideoInvertImages yes | no - If set to "no", xpdf's reverse-video mode inverts text and vec- - tor graphic content, but not images. If set to "yes", xpdf in- - verts images as well. The default is "no". + If set to "no", xpdf's reverse-video mode inverts text and vec- + tor graphic content, but not images. If set to "yes", xpdf + inverts images as well. The default is "no". popupMenuCmd title command ... - Add a command to the popup menu. Title is the text to be dis- - played in the menu. Command is an Xpdf command (see the COM- - MANDS section of the xpdf(1) man page for details). Multiple + Add a command to the popup menu. Title is the text to be dis- + played in the menu. Command is an Xpdf command (see the COM- + MANDS section of the xpdf(1) man page for details). Multiple commands are separated by whitespace. maxTileWidth pixels @@ -603,23 +578,17 @@ VIEWER SETTINGS ing pages. This defaults to 1500. maxTileHeight pixels - Set the maximum height of tiles to be used by xpdf when raster- + Set the maximum height of tiles to be used by xpdf when raster- izing pages. This defaults to 1500. tileCacheSize tiles - Set the maximum number of tiles to be cached by xpdf when ras- + Set the maximum number of tiles to be cached by xpdf when ras- terizing pages. This defaults to 10. workerThreads numThreads Set the number of worker threads to be used by xpdf when raster- izing pages. This defaults to 1. - allowLinksToChangeZoom yes | no - PDF links, including outline items, can include a new zoom - level. If this setting is "yes", Xpdf changes the zoom when - links are clicked; if "no", Xpdf moves to the destination but - does not change the zoom. This defaults to "yes". - launchCommand command Sets the command executed when you click on a "launch"-type link. The intent is for the command to be a program/script @@ -707,19 +676,7 @@ VIEWER SETTINGS tabStateFile path Sets the file used by the loadTabState and saveTabState commands - (see the xpdf(1) man page for more information). The default - path is ~/.xpdf.tabstate. - - sessionFile path - Sets the file used by the saveSession and loadSession commands - (see the xpdf(1) man page for more information). The default - path is ~/.xpdf.session. When xpdf automatically saves the ses- - sion via a session manager, it appends ".managed" to the path. - - saveSessionOnQuit yes | no - If set to "yes", xpdf will automatically save the current ses- - sion (equivalent to the saveSession command) when quitting (via - the menu or a key binding). The default value is "yes". + (see the xpdf(1) man page for more information). MISCELLANEOUS SETTINGS drawAnnotations yes | no @@ -816,7 +773,7 @@ FILES read in place of the system-wide file. AUTHOR - The Xpdf software and documentation are copyright 1996-2024 Glyph & + The Xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -826,4 +783,4 @@ SEE ALSO - 08 Feb 2024 xpdfrc(5) + 18 Apr 202 xpdfrc(5) diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc index 73cf2f59c15..e1951b08b9f 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h index ffa14cfeb6d..c9f93ebacda 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc index 01ae5acdcc1..6b3debb9dab 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include "gmempp.h" #include "FoFiEncodings.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h index 6094387d62d..dd85458c070 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc index fff1e26b346..4c6797ba9d6 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -839,8 +843,6 @@ static GList *getDfontFontList(FILE *f) { resNameListOffset >= resMapLength) { goto err2; } - nFonts = 0; - refListOffset = 0; for (i = 0; i < nTypes; ++i) { offset = resTypeListOffset + 2 + 8 * i; if (resMap[offset] == 0x73 && // 'sfnt' diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h index 497be445d6d..b0307a0b8d2 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class GList; //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc index a77b401cf55..57b12b14996 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #if HAVE_STD_SORT @@ -401,7 +405,7 @@ int FoFiTrueType::mapCodeToGID(int i, int c) { // to be 0xffff return 0; } - // invariant: seg[a].end < c <= seg[b].end + // invariant: seg[a].end < code <= seg[b].end while (b - a > 1 && ok) { m = (a + b) / 2; segEnd = getU16BE(pos + 14 + 2*m, &ok); @@ -435,31 +439,6 @@ int FoFiTrueType::mapCodeToGID(int i, int c) { } gid = getU16BE(pos + 10 + 2 * (c - cmapFirst), &ok); break; - case 12: - segCnt = getU32BE(pos + 12, &ok); - a = -1; - b = segCnt - 1; - segEnd = getU32BE(pos + 16 + 12*b + 4, &ok); - if (c > segEnd) { - return 0; - } - // invariant: seg[a].end < c <= seg[b].end - while (b - a > 1 && ok) { - m = (a + b) / 2; - segEnd = getU32BE(pos + 16 + 12*m + 4, &ok); - if (segEnd < c) { - a = m; - } else { - b = m; - } - } - segStart = getU32BE(pos + 16 + 12*b, &ok); - if (c < segStart) { - return 0; - } - segOffset = getU32BE(pos + 16 + 12*b + 8, &ok); - gid = segOffset + (c - segStart); - break; default: return 0; } diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h index 568ee845ff4..619e1bd6676 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "FoFiBase.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc index 87278e755a5..83ec53ef5e8 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h index 3576391f09e..4a64f246dcb 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "FoFiBase.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc index 64d676b195f..b6a13390b40 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -177,16 +181,16 @@ GString *FoFiType1C::getGlyphName(int gid) { GHash *FoFiType1C::getNameToGIDMap() { GHash *map; - char glyphName[256]; + char name[256]; GBool ok; int gid; map = new GHash(gTrue); for (gid = 0; gid < nGlyphs; ++gid) { ok = gTrue; - getString(charset[gid], glyphName, &ok); + getString(charset[gid], name, &ok); if (ok) { - map->add(new GString(glyphName), gid); + map->add(new GString(name), gid); } } return map; @@ -1523,7 +1527,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf, if (nOps < 6 || nOps % 6 != 0) { //~ error(-1, "Wrong number of args (%d) to Type 2 rrcurveto", nOps); } - for (k = 0; k+5 < nOps; k += 6) { + for (k = 0; k < nOps; k += 6) { cvtNum(ops[k], charBuf); cvtNum(ops[k+1], charBuf); cvtNum(ops[k+2], charBuf); @@ -1692,11 +1696,9 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf, cvtNum(ops[k+5], charBuf); charBuf->append((char)8); } - if (k+1 < nOps) { - cvtNum(ops[k], charBuf); - cvtNum(ops[k+1], charBuf); - charBuf->append((char)5); - } + cvtNum(ops[k], charBuf); + cvtNum(ops[k+1], charBuf); + charBuf->append((char)5); nOps = 0; openPath = gTrue; break; @@ -1709,15 +1711,13 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf, cvtNum(ops[k+1], charBuf); charBuf->append((char)5); } - if (k+5 < nOps) { - cvtNum(ops[k], charBuf); - cvtNum(ops[k+1], charBuf); - cvtNum(ops[k+2], charBuf); - cvtNum(ops[k+3], charBuf); - cvtNum(ops[k+4], charBuf); - cvtNum(ops[k+5], charBuf); - charBuf->append((char)8); - } + cvtNum(ops[k], charBuf); + cvtNum(ops[k+1], charBuf); + cvtNum(ops[k+2], charBuf); + cvtNum(ops[k+3], charBuf); + cvtNum(ops[k+4], charBuf); + cvtNum(ops[k+5], charBuf); + charBuf->append((char)8); nOps = 0; openPath = gTrue; break; @@ -2251,7 +2251,43 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, void *outputStream, int nWidths, Gushort *widths, Guchar *cmapTable, int cmapTableLen) { - Guchar os2Table[96], headTable[54], hheaTable[36], maxpTable[6]; + // dummy OS/2 table (taken from FoFiTrueType::writeTTF) + static Guchar os2Tab[86] = { + 0, 1, // version + 0, 1, // xAvgCharWidth + 0x01, 0x90, // usWeightClass + 0, 5, // usWidthClass + 0, 0, // fsType + 0, 0, // ySubscriptXSize + 0, 0, // ySubscriptYSize + 0, 0, // ySubscriptXOffset + 0, 0, // ySubscriptYOffset + 0, 0, // ySuperscriptXSize + 0, 0, // ySuperscriptYSize + 0, 0, // ySuperscriptXOffset + 0, 0, // ySuperscriptYOffset + 0, 0, // yStrikeoutSize + 0, 0, // yStrikeoutPosition + 0, 0, // sFamilyClass + 0, 0, 0, 0, 0, // panose + 0, 0, 0, 0, 0, + 0, 0, 0, 0, // ulUnicodeRange1 + 0, 0, 0, 0, // ulUnicodeRange2 + 0, 0, 0, 0, // ulUnicodeRange3 + 0, 0, 0, 0, // ulUnicodeRange4 + 0, 0, 0, 0, // achVendID + 0, 0, // fsSelection + 0, 0, // usFirstCharIndex + 0, 0, // usLastCharIndex + 0, 0, // sTypoAscender + 0, 0, // sTypoDescender + 0, 0, // sTypoLineGap + 0x20, 0x00, // usWinAscent + 0x20, 0x00, // usWinDescent + 0, 0, 0, 1, // ulCodePageRange1 + 0, 0, 0, 0 // ulCodePageRange2 + }; + Guchar headTable[54], hheaTable[36], maxpTable[6]; Guchar nameTable[26], postTable[32]; Guchar *hmtxTable; static const char *tableTag[9] = { @@ -2271,118 +2307,15 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, double mat[6]; Gushort maxWidth; Guint checksum, fileChecksum; - int unitsPerEm, xMin, yMin, xMax, yMax, ascent, descent, offset, i; - - xMin = (int)(topDict.fontBBox[0] + 0.5); - yMin = (int)(topDict.fontBBox[1] + 0.5); - xMax = (int)(topDict.fontBBox[2] + 0.5); - yMax = (int)(topDict.fontBBox[3] + 0.5); - ascent = yMax; - descent = -yMin; + int unitsPerEm, xMin, yMin, xMax, yMax, offset, i; //--- CFF_ table tableData[0] = file; tableLength[0] = len; //--- OS/2 table - os2Table[ 0] = 0; // version - os2Table[ 1] = 4; - os2Table[ 2] = 0; // xAvgCharWidth - os2Table[ 3] = 1; - os2Table[ 4] = 0x01; // usWeightClass - os2Table[ 5] = 0x90; - os2Table[ 6] = 0; // usWidthClass - os2Table[ 7] = 5; - os2Table[ 8] = 0; // fsType - os2Table[ 9] = 0; - os2Table[10] = 0; // ySubscriptXSize - os2Table[11] = 0; - os2Table[12] = 0; // ySubscriptYSize - os2Table[13] = 0; - os2Table[14] = 0; // ySubscriptXOffset - os2Table[15] = 0; - os2Table[16] = 0; // ySubscriptYOffset - os2Table[17] = 0; - os2Table[18] = 0; // ySuperscriptXSize - os2Table[19] = 0; - os2Table[20] = 0; // ySuperscriptYSize - os2Table[21] = 0; - os2Table[22] = 0; // ySuperscriptXOffset - os2Table[23] = 0; - os2Table[24] = 0; // ySuperscriptYOffset - os2Table[25] = 0; - os2Table[26] = 0; // yStrikeoutSize - os2Table[27] = 0; - os2Table[28] = 0; // yStrikeoutPosition - os2Table[29] = 0; - os2Table[30] = 0; // sFamilyClass - os2Table[31] = 0; - os2Table[32] = 0; // panose - os2Table[33] = 0; - os2Table[34] = 0; - os2Table[35] = 0; - os2Table[36] = 0; - os2Table[37] = 0; - os2Table[38] = 0; - os2Table[39] = 0; - os2Table[40] = 0; - os2Table[41] = 0; - os2Table[42] = 0; // ulUnicodeRange1 - os2Table[43] = 0; - os2Table[44] = 0; - os2Table[45] = 0; - os2Table[46] = 0; // ulUnicodeRange2 - os2Table[47] = 0; - os2Table[48] = 0; - os2Table[49] = 0; - os2Table[50] = 0; // ulUnicodeRange3 - os2Table[51] = 0; - os2Table[52] = 0; - os2Table[53] = 0; - os2Table[54] = 0; // ulUnicodeRange4 - os2Table[55] = 0; - os2Table[56] = 0; - os2Table[57] = 0; - os2Table[58] = 0; // achVendID - os2Table[59] = 0; - os2Table[60] = 0; - os2Table[61] = 0; - os2Table[62] = 0; // fsSelection - os2Table[63] = 0; - os2Table[64] = 0; // usFirstCharIndex - os2Table[65] = 0; - os2Table[66] = 0; // usLastCharIndex - os2Table[67] = 0; - os2Table[68] = 0; // sTypoAscender - os2Table[69] = 0; - os2Table[70] = 0; // sTypoDescender - os2Table[71] = 0; - os2Table[72] = 0; // sTypoLineGap - os2Table[73] = 0; - os2Table[74] = (Guchar)(ascent >> 8); // usWinAscent - os2Table[75] = (Guchar)ascent; - os2Table[76] = (Guchar)(descent >> 8); // usWinDescent - os2Table[77] = (Guchar)descent; - os2Table[78] = 0; // ulCodePageRange1 - os2Table[79] = 0; - os2Table[80] = 0; - os2Table[81] = 1; - os2Table[82] = 0; // ulCodePageRange2 - os2Table[83] = 0; - os2Table[84] = 0; - os2Table[85] = 0; - os2Table[86] = 0; // sxHeight - os2Table[87] = 0; - os2Table[88] = 0; // sCapHeight - os2Table[89] = 0; - os2Table[90] = 0; // usDefaultChar - os2Table[91] = 0; - os2Table[92] = 0; // usBreakChar - os2Table[93] = 0; - os2Table[94] = 0; // usMaxContext - os2Table[95] = 0; - tableData[1] = os2Table; - tableLength[1] = 96; + tableData[1] = os2Tab; + tableLength[1] = 86; //--- cmap table tableData[2] = cmapTable; @@ -2395,14 +2328,18 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, } else { unitsPerEm = (int)(1 / mat[0] + 0.5); } + xMin = (int)(topDict.fontBBox[0] + 0.5); + yMin = (int)(topDict.fontBBox[1] + 0.5); + xMax = (int)(topDict.fontBBox[2] + 0.5); + yMax = (int)(topDict.fontBBox[3] + 0.5); headTable[ 0] = 0x00; // version headTable[ 1] = 0x01; headTable[ 2] = 0x00; headTable[ 3] = 0x00; headTable[ 4] = 0x00; // revision - headTable[ 5] = 0x01; // (needs to be non-zero) + headTable[ 5] = 0x00; headTable[ 6] = 0x00; - headTable[ 7] = 0x01; + headTable[ 7] = 0x00; headTable[ 8] = 0x00; // checksumAdjustment headTable[ 9] = 0x00; // (set later) headTable[10] = 0x00; @@ -2453,8 +2390,8 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, tableLength[3] = 54; //--- hhea table - maxWidth = 0; - for (i = 0; i < nWidths; ++i) { + maxWidth = widths[0]; + for (i = 1; i < nWidths; ++i) { if (widths[i] > maxWidth) { maxWidth = widths[i]; } @@ -2722,10 +2659,6 @@ GBool FoFiType1C::parse() { return gFalse; } nFDs = fdIdx.len; - if (nFDs < 1) { - parsedOk = gFalse; - return gFalse; - } privateDicts = (Type1CPrivateDict *) gmallocn(nFDs, sizeof(Type1CPrivateDict)); for (i = 0; i < nFDs; ++i) { diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h index 301f42d85e8..15a823cffe6 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "FoFiBase.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc index 8c4c474f5f1..503a06aa9c7 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc @@ -12,6 +12,10 @@ #if USE_FIXEDPOINT +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "FixedPoint.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h index 31f2ca4dad2..9f0c3240627 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h @@ -15,6 +15,10 @@ #if USE_FIXEDPOINT +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include #include #include "gtypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc b/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc index c77a1b90db0..e6b32440fb9 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GHash.h b/Build/source/libs/xpdf/xpdf-src/goo/GHash.h index 92ce226d7bd..179753a50b4 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GHash.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/GHash.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" class GString; diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GList.cc b/Build/source/libs/xpdf/xpdf-src/goo/GList.cc index 7aaa5d7176f..c194818a743 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GList.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/GList.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" @@ -96,11 +100,6 @@ void GList::sort(int (*cmp)(const void *obj1, const void *obj2)) { qsort(data, length, sizeof(void *), cmp); } -void GList::sort(int first, int n, - int (*cmp)(const void *ptr1, const void *ptr2)) { - qsort(data + first, n, sizeof(void *), cmp); -} - void GList::reverse() { void *t; int n, i; diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GList.h b/Build/source/libs/xpdf/xpdf-src/goo/GList.h index ee12346c5cf..005043726a5 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GList.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/GList.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ @@ -66,9 +70,6 @@ public: // be double-dereferenced. void sort(int (*cmp)(const void *ptr1, const void *ptr2)); - // Sort items starting at . - void sort(int first, int n, int (*cmp)(const void *ptr1, const void *ptr2)); - // Reverse the list. void reverse(); diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GString.cc b/Build/source/libs/xpdf/xpdf-src/goo/GString.cc index 1e41bcaa172..54de35b0a75 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GString.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/GString.cc @@ -10,6 +10,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -412,8 +416,6 @@ GString *GString::appendfv(const char *fmt, va_list argList) { // format the argument arg = args[idx]; - str = NULL; - len = 0; switch (ft) { case fmtIntDecimal: formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 10, &str, &len); diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GString.h b/Build/source/libs/xpdf/xpdf-src/goo/GString.h index 2e67fd0c0d0..6b342f85ec7 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GString.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/GString.h @@ -13,6 +13,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include // for LLONG_MAX and ULLONG_MAX #include #include "gtypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc b/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc index e1fdf297689..c2e7512e188 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc @@ -418,18 +418,6 @@ GBool pathIsFile(const char *path) { #endif } -GBool pathIsDir(const char *path) { -#ifdef _WIN32 - wchar_t wPath[winMaxLongPath + 1]; - fileNameToUCS2(path, wPath, winMaxLongPath + 1); - DWORD attr = GetFileAttributesW(wPath); - return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY); -#else - struct stat statBuf; - return stat(path, &statBuf) == 0 && S_ISDIR(statBuf.st_mode); -#endif -} - time_t getModTime(char *fileName) { #ifdef _WIN32 //~ should implement this, but it's (currently) only used in xpdf @@ -614,17 +602,6 @@ GString *fileNameToUTF8(wchar_t *path) { return s; } -GString *fileNameMultiByteToUTF8(char *path) { - wchar_t fileNameW[winMaxLongPath + 1]; - if (MultiByteToWideChar(CP_OEMCP, 0, path, -1, - fileNameW, sizeof(fileNameW) / sizeof(wchar_t))) { - return fileNameToUTF8(fileNameW); - } else { - // shouldn't happen, but just in case... - return new GString(path); - } -} - wchar_t *fileNameToUCS2(const char *path, wchar_t *out, size_t outSize) { const char *p; size_t i; @@ -703,7 +680,7 @@ void readWindowsShortcut(wchar_t *wPath, size_t wPathSize) { } hres = persistFile->Load(wPath, STGM_READ); if (FAILED(hres)) { - fprintf(stderr, "IPersistFile.Load failed: 0x%08lx\n", hres); + fprintf(stderr, "IPersistFile.Load failed: 0x%08x\n", hres); exit(1); } wchar_t target[winMaxLongPath + 1]; diff --git a/Build/source/libs/xpdf/xpdf-src/goo/gfile.h b/Build/source/libs/xpdf/xpdf-src/goo/gfile.h index 9dbb1c9b8ee..d0d2ad6f9e1 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/gfile.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/gfile.h @@ -64,9 +64,6 @@ extern GString *makePathAbsolute(GString *path); // Returns true if [path] exists and is a regular file. extern GBool pathIsFile(const char *path); -// Returns true if [path] exists and is a directory. -extern GBool pathIsDir(const char *path); - // Get the modification time for . Returns 0 if there is an // error. extern time_t getModTime(char *fileName); @@ -93,9 +90,6 @@ extern GString *fileNameToUTF8(char *path); // Convert a file name from UCS-2 to UTF-8. extern GString *fileNameToUTF8(wchar_t *path); -// Convert a file name from the OEM code page to UTF-8. -extern GString *fileNameMultiByteToUTF8(char *path); - // Convert a file name from UTF-8 to UCS-2. [out] has space for // [outSize] wchar_t elements (including the trailing zero). Returns // [out]. diff --git a/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc b/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc index 0ed8cf5d888..4afe21b4a25 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -4926,7 +4930,7 @@ void Splash::clear(SplashColorPtr color, Guchar alpha) { SplashError Splash::stroke(SplashPath *path) { SplashPath *path2, *dPath; - SplashCoord w, w2, lineDashMax, lineDashTotal; + SplashCoord t0, t1, t2, t3, w, w2, lineDashMax, lineDashTotal; int lineCap, lineJoin, i; if (debugMode) { @@ -4938,9 +4942,6 @@ SplashError Splash::stroke(SplashPath *path) { if (path->length == 0) { return splashErrEmptyPath; } - if (pathAllOutside(path, gTrue)) { - return splashOk; - } path2 = flattenPath(path, state->matrix, state->flatness); // Compute an approximation of the transformed line width. @@ -4952,13 +4953,15 @@ SplashError Splash::stroke(SplashPath *path) { // [0 +/-s] [+/-s 0] // well, and still does something reasonable for the uncommon // case transforms. - double t0 = splashAbs(state->matrix[0]); - double t1 = splashAbs(state->matrix[1]); - double t2 = splashAbs(state->matrix[2]); - double t3 = splashAbs(state->matrix[3]); - double t01 = t0 * t0 + t1 * t1; - double t23 = t2 * t2 + t3 * t3; - w = sqrt((t01 > t23) ? t01 : t23); + t0 = splashAbs(state->matrix[0]); + t1 = splashAbs(state->matrix[1]); + t2 = splashAbs(state->matrix[2]); + t3 = splashAbs(state->matrix[3]); + if (t0 * t3 >= t1 * t2) { + w = (t0 < t3) ? t0 : t3; + } else { + w = (t1 < t2) ? t1 : t2; + } w2 = w * state->lineWidth; // construct the dashed path @@ -5053,7 +5056,7 @@ void Splash::strokeNarrow(SplashPath *path) { xPath = new SplashXPath(path, state->matrix, state->flatness, gFalse, state->enablePathSimplification, - state->strokeAdjust, state->clip); + state->strokeAdjust); pipeInit(&pipe, state->strokePattern, (Guchar)splashRound(state->strokeAlpha * 255), @@ -5071,44 +5074,6 @@ void Splash::strokeNarrow(SplashPath *path) { x0 = splashFloor(seg->x1); x1 = splashFloor(seg->x0); } - - // With CAD-mode stroke adjustment, and a simple rectangular clip - // region, horizontal and vertical stroke-adjusted edges that fall - // slightly outside the clip region are adjusted back inside the - // clip region. This avoids problems with narrow lines in - // slightly mismatched clip rectangles, which appear to be - // generated somewhat commonly by buggy CAD software. This is - // similar to the code in SplashXPath::strokeAdjust() -- narrow - // strokes aren't stroke-adjusted, so this tweak has to be done - // here. - if (y0 == y1 && - seg->y0 == seg->y1 && - state->clip->getIsSimple() && - state->strokeAdjust == splashStrokeAdjustCAD) { - SplashCoord cy0 = state->clip->getYMin(); - SplashCoord cy1 = state->clip->getYMax(); - int cyi0 = state->clip->getYMinI(state->strokeAdjust); - int cyi1 = state->clip->getYMaxI(state->strokeAdjust); - if (y0 == cyi0 - 1 && cy0 - seg->y0 < 0.5) { - y0 = y1 = y0 + 1; - } else if (y0 == cyi1 + 1 && seg->y0 - cy1 < 0.5) { - y0 = y1 = y0 - 1; - } - } else if (x0 == x1 && - seg->x0 == seg->x1 && - state->clip->getIsSimple() && - state->strokeAdjust == splashStrokeAdjustCAD) { - SplashCoord cx0 = state->clip->getXMin(); - SplashCoord cx1 = state->clip->getXMax(); - int cxi0 = state->clip->getXMinI(state->strokeAdjust); - int cxi1 = state->clip->getXMaxI(state->strokeAdjust); - if (x0 == cxi0 - 1 && cx0 - seg->x0 < 0.5) { - x0 = x1 = x0 + 1; - } else if (x0 == cxi1 + 1 && seg->x0 - cx1 < 0.5) { - x0 = x1 = x0 - 1; - } - } - if ((clipRes = state->clip->testRect(x0 <= x1 ? x0 : x1, y0, x0 <= x1 ? x1 : x0, y1, state->strokeAdjust)) @@ -5119,18 +5084,6 @@ void Splash::strokeNarrow(SplashPath *path) { } else { drawStrokeSpan(&pipe, x1, x0, y0, clipRes == splashClipAllInside); } - } else if (x0 == x1) { - y = state->clip->getYMinI(state->strokeAdjust); - if (y0 < y) { - y0 = y; - } - y = state->clip->getYMaxI(state->strokeAdjust); - if (y1 > y) { - y1 = y; - } - for (y = y0; y <= y1; ++y) { - drawStrokeSpan(&pipe, x0, x0, y, clipRes == splashClipAllInside); - } } else { dxdy = seg->dxdy; y = state->clip->getYMinI(state->strokeAdjust); @@ -5141,7 +5094,7 @@ void Splash::strokeNarrow(SplashPath *path) { y = state->clip->getYMaxI(state->strokeAdjust); if (y1 > y) { y1 = y; - x1 = splashFloor(seg->x0 + ((SplashCoord)y1 + 1 - seg->y0) * dxdy); + x1 = splashFloor(seg->x0 + ((SplashCoord)y1 - seg->y0) * dxdy); } if (x0 <= x1) { xa = x0; @@ -5182,7 +5135,6 @@ void Splash::strokeNarrow(SplashPath *path) { } ++nClipRes[clipRes]; } - if (nClipRes[splashClipPartial] || (nClipRes[splashClipAllInside] && nClipRes[splashClipAllOutside])) { opClipRes = splashClipPartial; @@ -5374,14 +5326,16 @@ SplashPath *Splash::makeDashedPath(SplashPath *path) { return new SplashPath(); } lineDashStartPhase = state->lineDashPhase; - if (lineDashStartPhase > 0) { - i = splashFloor(lineDashStartPhase / lineDashTotal); - lineDashStartPhase -= lineDashTotal * i; - } else { - i = splashCeil(-lineDashStartPhase / lineDashTotal); - lineDashStartPhase += lineDashTotal * i; - } - lineDashStartOn = !((state->lineDashLength & 1) && (i & 1)); + if (lineDashStartPhase > lineDashTotal * 2) { + i = splashFloor(lineDashStartPhase / (lineDashTotal * 2)); + lineDashStartPhase -= lineDashTotal * i * 2; + } else if (lineDashStartPhase < 0) { + i = splashCeil(-lineDashStartPhase / (lineDashTotal * 2)); + lineDashStartPhase += lineDashTotal * i * 2; + } + i = splashFloor(lineDashStartPhase / lineDashTotal); + lineDashStartPhase -= (SplashCoord)i * lineDashTotal; + lineDashStartOn = gTrue; lineDashStartIdx = 0; if (lineDashStartPhase > 0) { while (lineDashStartPhase >= state->lineDash[lineDashStartIdx]) { @@ -5423,14 +5377,6 @@ SplashPath *Splash::makeDashedPath(SplashPath *path) { y1 = path->pts[k+1].y; segLen = splashDist(x0, y0, x1, y1); - // Special case for zero-length subpath: copy the zero-length - // segment into the dashed path so that the round line cap - // special case is handled. - if (j == i+1 && segLen == 0) { - dPath->moveTo(x0, y0); - dPath->lineTo(x0, y0); - } - // process the segment while (segLen > 0) { @@ -5531,13 +5477,6 @@ SplashError Splash::fill(SplashPath *path, GBool eo) { printf("fill [eo:%d]:\n", eo); dumpPath(path); } - if (path->length == 0) { - return splashErrEmptyPath; - } - if (pathAllOutside(path, gFalse)) { - opClipRes = splashClipAllOutside; - return splashOk; - } return fillWithPattern(path, eo, state->fillPattern, state->fillAlpha); } @@ -5551,11 +5490,19 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo, int xMin, yMin, xMax, xMin2, xMax2, yMax, y, t; SplashClipResult clipRes; + if (path->length == 0) { + return splashErrEmptyPath; + } + if (pathAllOutside(path)) { + opClipRes = splashClipAllOutside; + return splashOk; + } + path2 = tweakFillPath(path); xPath = new SplashXPath(path2, state->matrix, state->flatness, gTrue, state->enablePathSimplification, - state->strokeAdjust, state->clip); + state->strokeAdjust); if (path2 != path) { delete path2; } @@ -5731,17 +5678,13 @@ SplashPath *Splash::tweakFillPath(SplashPath *path) { return path2; } -// Returns true if [path] is entirely outside the current clipping -// path. The path coordinates have not been stroke adjusted, so we -// compare against the floating point clip rect. If [stroke] is true, -// allow for the stroke width and miter limit. -GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) { +GBool Splash::pathAllOutside(SplashPath *path) { SplashCoord xMin1, yMin1, xMax1, yMax1; SplashCoord xMin2, yMin2, xMax2, yMax2; SplashCoord x, y; + int xMinI, yMinI, xMaxI, yMaxI; int i; - //--- compute the path's bbox in user space xMin1 = xMax1 = path->pts[0].x; yMin1 = yMax1 = path->pts[0].y; for (i = 1; i < path->length; ++i) { @@ -5757,19 +5700,6 @@ GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) { } } - //--- allow for stroke width and miter limit - if (stroke && state->lineWidth > 0) { - SplashCoord w = state->lineWidth * 0.5; - if (state->lineJoin == splashLineJoinMiter) { - w *= state->miterLimit; - } - xMin1 -= w; - yMin1 -= w; - xMax1 += w; - yMax1 += w; - } - - //--- convert path bbox to device space transform(state->matrix, xMin1, yMin1, &x, &y); xMin2 = xMax2 = x; yMin2 = yMax2 = y; @@ -5806,20 +5736,18 @@ GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) { } else if (y > yMax2) { yMax2 = y; } + // sanity-check the coordinates - xMinI/yMinI/xMaxI/yMaxI are + // 32-bit integers, so coords need to be < 2^31 + SplashXPath::clampCoords(&xMin2, &yMin2); + SplashXPath::clampCoords(&xMax2, &yMax2); + xMinI = splashFloor(xMin2); + yMinI = splashFloor(yMin2); + xMaxI = splashFloor(xMax2); + yMaxI = splashFloor(yMax2); - //--- handle zero-width strokes - if (stroke && state->lineWidth == 0) { - xMin1 -= 1; - yMin1 -= 1; - xMax1 += 1; - yMax1 += 1; - } - - //--- check against the clip rect - return xMin2 > state->clip->getXMax() || - xMax2 < state->clip->getXMin() || - yMin2 > state->clip->getYMax() || - yMax2 < state->clip->getYMin(); + return state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI, + state->strokeAdjust) == + splashClipAllOutside; } SplashError Splash::fillChar(SplashCoord x, SplashCoord y, @@ -6094,9 +6022,6 @@ SplashError Splash::fillImageMask(GString *imageTag, SplashClipResult clipRes = state->clip->testRect(xMin, yMin, xMax - 1, yMax - 1, state->strokeAdjust); - if (clipRes == splashClipAllOutside) { - return splashOk; - } // If the scaled mask is much wider and/or taller than the clip // region, we use the "arbitrary" scaling path, to avoid a // potentially very slow loop in the flips-only path (which scans @@ -6129,88 +6054,92 @@ SplashError Splash::fillImageMask(GString *imageTag, //--- horizontal/vertical flips only if (flipsOnly && !veryLarge) { - int scaledWidth = xMax - xMin; - int scaledHeight = yMax - yMin; - ImageMaskScaler scaler(src, srcData, w, h, - scaledWidth, scaledHeight, interpolate, antialias); - Guchar *tmpLine = NULL; - if (horizFlip) { - tmpLine = (Guchar *)gmalloc(scaledWidth); - } - if (vertFlip) { - if (horizFlip) { // bottom-up, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); - (this->*drawRowFunc)(&dd, tmpLine, - xMin, yMax - 1 - y, scaledWidth); - } - } else { // bottom-up - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - (this->*drawRowFunc)(&dd, scaler.data(), - xMin, yMax - 1 - y, scaledWidth); - } + if (clipRes != splashClipAllOutside) { + int scaledWidth = xMax - xMin; + int scaledHeight = yMax - yMin; + ImageMaskScaler scaler(src, srcData, w, h, + scaledWidth, scaledHeight, interpolate, antialias); + Guchar *tmpLine = NULL; + if (horizFlip) { + tmpLine = (Guchar *)gmalloc(scaledWidth); } - } else { - if (horizFlip) { // top-down, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); - (this->*drawRowFunc)(&dd, tmpLine, - xMin, yMin + y, scaledWidth); + if (vertFlip) { + if (horizFlip) { // bottom-up, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); + (this->*drawRowFunc)(&dd, tmpLine, + xMin, yMax - 1 - y, scaledWidth); + } + } else { // bottom-up + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + (this->*drawRowFunc)(&dd, scaler.data(), + xMin, yMax - 1 - y, scaledWidth); + } } - } else { // top-down - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - (this->*drawRowFunc)(&dd, scaler.data(), - xMin, yMin + y, scaledWidth); + } else { + if (horizFlip) { // top-down, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); + (this->*drawRowFunc)(&dd, tmpLine, + xMin, yMin + y, scaledWidth); + } + } else { // top-down + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + (this->*drawRowFunc)(&dd, scaler.data(), + xMin, yMin + y, scaledWidth); + } } } + gfree(tmpLine); } - gfree(tmpLine); //--- 90/270 rotation } else if (rot90Only && !veryLarge) { + if (clipRes != splashClipAllOutside) { - // scale the mask - int scaledWidth = yMax - yMin; - int scaledHeight = xMax - xMin; - ImageMaskScaler scaler(src, srcData, w, h, - scaledWidth, scaledHeight, interpolate, antialias); - Guchar *scaledMask = (Guchar *)gmallocn64(scaledHeight, scaledWidth); - Guchar *ptr = scaledMask; - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - memcpy(ptr, scaler.data(), scaledWidth); - ptr += scaledWidth; - } - - // draw it - Guchar *tmpLine = (Guchar *)gmalloc(scaledHeight); - for (int y = 0; y < scaledWidth; ++y) { - if (vertFlip) { - ptr = scaledMask + (scaledWidth - 1 - y); - } else { - ptr = scaledMask + y; + // scale the mask + int scaledWidth = yMax - yMin; + int scaledHeight = xMax - xMin; + ImageMaskScaler scaler(src, srcData, w, h, + scaledWidth, scaledHeight, interpolate, antialias); + Guchar *scaledMask = (Guchar *)gmallocn(scaledHeight, scaledWidth); + Guchar *ptr = scaledMask; + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + memcpy(ptr, scaler.data(), scaledWidth); + ptr += scaledWidth; } - if (horizFlip) { - ptr += (scaledHeight - 1) * scaledWidth; - for (int x = 0; x < scaledHeight; ++x) { - tmpLine[x] = *ptr; - ptr -= scaledWidth; + + // draw it + Guchar *tmpLine = (Guchar *)gmalloc(scaledHeight); + for (int y = 0; y < scaledWidth; ++y) { + if (vertFlip) { + ptr = scaledMask + (scaledWidth - 1 - y); + } else { + ptr = scaledMask + y; } - } else { - for (int x = 0; x < scaledHeight; ++x) { - tmpLine[x] = *ptr; - ptr += scaledWidth; + if (horizFlip) { + ptr += (scaledHeight - 1) * scaledWidth; + for (int x = 0; x < scaledHeight; ++x) { + tmpLine[x] = *ptr; + ptr -= scaledWidth; + } + } else { + for (int x = 0; x < scaledHeight; ++x) { + tmpLine[x] = *ptr; + ptr += scaledWidth; + } } + (this->*drawRowFunc)(&dd, tmpLine, xMin, yMin + y, scaledHeight); } - (this->*drawRowFunc)(&dd, tmpLine, xMin, yMin + y, scaledHeight); - } - gfree(tmpLine); - gfree(scaledMask); + gfree(tmpLine); + gfree(scaledMask); + } //--- arbitrary transform } else { @@ -6260,7 +6189,7 @@ SplashError Splash::fillImageMask(GString *imageTag, // if downscaling: store the downscaled image mask // if upscaling: store the unscaled image mask - Guchar *scaledMask = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + Guchar *scaledMask = (Guchar *)gmallocn(scaledHeight, scaledWidth); if (downscaling) { ImageMaskScaler scaler(src, srcData, w, h, scaledWidth, scaledHeight, interpolate, antialias); @@ -6342,7 +6271,7 @@ void Splash::drawImageMaskArbitraryNoInterp( + (SplashCoord)y * invMat[3] + invMat[5]); if (xx >= 0 && xx < scaledWidth && yy >= 0 && yy < scaledHeight) { - Guchar *p = scaledMask + (yy * (SplashBitmapRowSize)scaledWidth + xx); + Guchar *p = scaledMask + (yy * scaledWidth + xx); Guchar *q = buf + (x - xMin); *q = *p; if (x < rowMin) { @@ -6420,10 +6349,10 @@ void Splash::drawImageMaskArbitraryInterp( if (y1 >= scaledHeight) { y1 = scaledHeight - 1; } - Guchar *p00 = scaledMask + (y0 * (SplashBitmapRowSize)scaledWidth + x0); - Guchar *p10 = scaledMask + (y0 * (SplashBitmapRowSize)scaledWidth + x1); - Guchar *p01 = scaledMask + (y1 * (SplashBitmapRowSize)scaledWidth + x0); - Guchar *p11 = scaledMask + (y1 * (SplashBitmapRowSize)scaledWidth + x1); + Guchar *p00 = scaledMask + (y0 * scaledWidth + x0); + Guchar *p10 = scaledMask + (y0 * scaledWidth + x1); + Guchar *p01 = scaledMask + (y1 * scaledWidth + x0); + Guchar *p11 = scaledMask + (y1 * scaledWidth + x1); Guchar *q = buf + (x - xMin); *q = (Guchar)(int)(sx0 * (sy0 * (int)*p00 + sy1 * (int)*p01) + sx1 * (sy0 * (int)*p10 + sy1 * (int)*p11)); @@ -6640,9 +6569,6 @@ SplashError Splash::drawImage(GString *imageTag, SplashClipResult clipRes = state->clip->testRect(xMin, yMin, xMax - 1, yMax - 1, state->strokeAdjust); - if (clipRes == splashClipAllOutside) { - return splashOk; - } // If the scaled image is much wider and/or taller than the clip // region, we use the arbitrary transform path, to avoid a // potentially very slow loop in the flips-only path (which scans @@ -6690,133 +6616,136 @@ SplashError Splash::drawImage(GString *imageTag, //--- horizontal/vertical flips only if (flipsOnly && !veryLarge) { - int scaledWidth = xMax - xMin; - int scaledHeight = yMax - yMin; - ImageScaler *scaler = getImageScaler(imageTag, src, srcData, - w, h, nComps, - scaledWidth, scaledHeight, - srcMode, srcAlpha, interpolate); - Guchar *tmpLine = NULL; - Guchar *tmpAlphaLine = NULL; - if (horizFlip) { - tmpLine = (Guchar *)gmallocn(scaledWidth, nComps); - if (srcAlpha) { - tmpAlphaLine = (Guchar *)gmalloc(scaledWidth); - } - } - if (vertFlip) { - if (horizFlip) { // bottom-up, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - mirrorImageRow(scaler->colorData(), scaler->alphaData(), - tmpLine, tmpAlphaLine, - scaledWidth, nComps, srcAlpha); - (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, - xMin, yMax - 1 - y, scaledWidth); - } - } else { // bottom-up - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), - xMin, yMax - 1 - y, scaledWidth); + if (clipRes != splashClipAllOutside) { + int scaledWidth = xMax - xMin; + int scaledHeight = yMax - yMin; + ImageScaler *scaler = getImageScaler(imageTag, src, srcData, + w, h, nComps, + scaledWidth, scaledHeight, + srcMode, srcAlpha, interpolate); + Guchar *tmpLine = NULL; + Guchar *tmpAlphaLine = NULL; + if (horizFlip) { + tmpLine = (Guchar *)gmallocn(scaledWidth, nComps); + if (srcAlpha) { + tmpAlphaLine = (Guchar *)gmalloc(scaledWidth); } } - } else { - if (horizFlip) { // top-down, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - mirrorImageRow(scaler->colorData(), scaler->alphaData(), - tmpLine, tmpAlphaLine, - scaledWidth, nComps, srcAlpha); - (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, - xMin, yMin + y, scaledWidth); + if (vertFlip) { + if (horizFlip) { // bottom-up, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + mirrorImageRow(scaler->colorData(), scaler->alphaData(), + tmpLine, tmpAlphaLine, + scaledWidth, nComps, srcAlpha); + (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, + xMin, yMax - 1 - y, scaledWidth); + } + } else { // bottom-up + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), + xMin, yMax - 1 - y, scaledWidth); + } } - } else { // top-down - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), - xMin, yMin + y, scaledWidth); + } else { + if (horizFlip) { // top-down, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + mirrorImageRow(scaler->colorData(), scaler->alphaData(), + tmpLine, tmpAlphaLine, + scaledWidth, nComps, srcAlpha); + (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, + xMin, yMin + y, scaledWidth); + } + } else { // top-down + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), + xMin, yMin + y, scaledWidth); + } } } + gfree(tmpLine); + gfree(tmpAlphaLine); + delete scaler; } - gfree(tmpLine); - gfree(tmpAlphaLine); - delete scaler; //--- 90/270 rotation } else if (rot90Only && !veryLarge) { - - // scale the image - int scaledWidth = yMax - yMin; - int scaledHeight = xMax - xMin; - Guchar *scaledColor, *scaledAlpha; - GBool freeScaledImage; - getScaledImage(imageTag, src, srcData, w, h, nComps, - scaledWidth, scaledHeight, srcMode, srcAlpha, interpolate, - &scaledColor, &scaledAlpha, &freeScaledImage); - - // draw it - Guchar *tmpLine = (Guchar *)gmallocn(scaledHeight, nComps); - Guchar *tmpAlphaLine = NULL; - if (srcAlpha) { - tmpAlphaLine = (Guchar *)gmalloc(scaledHeight); - } - for (int y = 0; y < scaledWidth; ++y) { - Guchar *ptr = NULL; - Guchar *alphaPtr = NULL; - if (vertFlip) { - ptr = scaledColor + ((SplashBitmapRowSize)scaledWidth - 1 - y) * nComps; - if (srcAlpha) { - alphaPtr = scaledAlpha + (scaledWidth - 1 - y); - } - } else { - ptr = scaledColor + y * nComps; - if (srcAlpha) { - alphaPtr = scaledAlpha + y; - } + if (clipRes != splashClipAllOutside) { + + // scale the image + int scaledWidth = yMax - yMin; + int scaledHeight = xMax - xMin; + Guchar *scaledColor, *scaledAlpha; + GBool freeScaledImage; + getScaledImage(imageTag, src, srcData, w, h, nComps, + scaledWidth, scaledHeight, srcMode, srcAlpha, interpolate, + &scaledColor, &scaledAlpha, &freeScaledImage); + + // draw it + Guchar *tmpLine = (Guchar *)gmallocn(scaledHeight, nComps); + Guchar *tmpAlphaLine = NULL; + if (srcAlpha) { + tmpAlphaLine = (Guchar *)gmalloc(scaledHeight); } - if (horizFlip) { - ptr += (scaledHeight - 1) * (SplashBitmapRowSize)scaledWidth * nComps; - Guchar *q = tmpLine; - for (int x = 0; x < scaledHeight; ++x) { - for (int i = 0; i < nComps; ++i) { - *q++ = ptr[i]; + for (int y = 0; y < scaledWidth; ++y) { + Guchar *ptr, *alphaPtr; + if (vertFlip) { + ptr = scaledColor + (scaledWidth - 1 - y) * nComps; + if (srcAlpha) { + alphaPtr = scaledAlpha + (scaledWidth - 1 - y); + } + } else { + ptr = scaledColor + y * nComps; + if (srcAlpha) { + alphaPtr = scaledAlpha + y; } - ptr -= scaledWidth * nComps; } - if (srcAlpha) { - alphaPtr += (scaledHeight - 1) * (SplashBitmapRowSize)scaledWidth; - q = tmpAlphaLine; + if (horizFlip) { + ptr += (scaledHeight - 1) * scaledWidth * nComps; + Guchar *q = tmpLine; for (int x = 0; x < scaledHeight; ++x) { - *q++ = *alphaPtr; - alphaPtr -= scaledWidth; + for (int i = 0; i < nComps; ++i) { + *q++ = ptr[i]; + } + ptr -= scaledWidth * nComps; } - } - } else { - Guchar *q = tmpLine; - for (int x = 0; x < scaledHeight; ++x) { - for (int i = 0; i < nComps; ++i) { - *q++ = ptr[i]; + if (srcAlpha) { + alphaPtr += (scaledHeight - 1) * scaledWidth; + q = tmpAlphaLine; + for (int x = 0; x < scaledHeight; ++x) { + *q++ = *alphaPtr; + alphaPtr -= scaledWidth; + } } - ptr += scaledWidth * nComps; - } - if (srcAlpha) { - q = tmpAlphaLine; + } else { + Guchar *q = tmpLine; for (int x = 0; x < scaledHeight; ++x) { - *q++ = *alphaPtr; - alphaPtr += scaledWidth; + for (int i = 0; i < nComps; ++i) { + *q++ = ptr[i]; + } + ptr += scaledWidth * nComps; + } + if (srcAlpha) { + q = tmpAlphaLine; + for (int x = 0; x < scaledHeight; ++x) { + *q++ = *alphaPtr; + alphaPtr += scaledWidth; + } } } + (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, + xMin, yMin + y, scaledHeight); } - (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, - xMin, yMin + y, scaledHeight); - } - gfree(tmpLine); - gfree(tmpAlphaLine); - if (freeScaledImage) { - gfree(scaledColor); - gfree(scaledAlpha); + gfree(tmpLine); + gfree(tmpAlphaLine); + if (freeScaledImage) { + gfree(scaledColor); + gfree(scaledAlpha); + } } //--- arbitrary transform @@ -6922,9 +6851,9 @@ ImageScaler *Splash::getImageScaler(GString *imageTag, } else { lineSize = -1; } - imageCache->colorData = (Guchar *)gmallocn64(scaledHeight, lineSize); + imageCache->colorData = (Guchar *)gmallocn(scaledHeight, lineSize); if (srcAlpha) { - imageCache->alphaData = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + imageCache->alphaData = (Guchar *)gmallocn(scaledHeight, scaledWidth); } return new SavingImageScaler(src, srcData, w, h, nComps, srcAlpha, @@ -6965,9 +6894,9 @@ void Splash::getScaledImage(GString *imageTag, } else { lineSize = -1; } - *scaledColor = (Guchar *)gmallocn64(scaledHeight, lineSize); + *scaledColor = (Guchar *)gmallocn(scaledHeight, lineSize); if (srcAlpha) { - *scaledAlpha = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + *scaledAlpha = (Guchar *)gmallocn(scaledHeight, scaledWidth); } else { *scaledAlpha = NULL; } @@ -7009,9 +6938,9 @@ void Splash::getScaledImage(GString *imageTag, } else { lineSize = -1; } - imageCache->colorData = (Guchar *)gmallocn64(scaledHeight, lineSize); + imageCache->colorData = (Guchar *)gmallocn(scaledHeight, lineSize); if (srcAlpha) { - imageCache->alphaData = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + imageCache->alphaData = (Guchar *)gmallocn(scaledHeight, scaledWidth); } if (scaledWidth == w && scaledHeight == h) { Guchar *colorPtr = imageCache->colorData; @@ -7092,15 +7021,13 @@ void Splash::drawImageArbitraryNoInterp(Guchar *scaledColor, + (SplashCoord)y * invMat[3] + invMat[5]); if (xx >= 0 && xx < scaledWidth && yy >= 0 && yy < scaledHeight) { - Guchar *p = scaledColor + - (yy * (SplashBitmapRowSize)scaledWidth + xx) * nComps; + Guchar *p = scaledColor + (yy * scaledWidth + xx) * nComps; Guchar *q = colorBuf + (x - xMin) * nComps; for (int i = 0; i < nComps; ++i) { *q++ = *p++; } if (srcAlpha) { - alphaBuf[x - xMin] = - scaledAlpha[yy * (SplashBitmapRowSize)scaledWidth + xx]; + alphaBuf[x - xMin] = scaledAlpha[yy * scaledWidth + xx]; } if (x < rowMin) { rowMin = x; @@ -7184,24 +7111,20 @@ void Splash::drawImageArbitraryInterp(Guchar *scaledColor, Guchar *scaledAlpha, if (y1 >= scaledHeight) { y1 = scaledHeight - 1; } - Guchar *p00 = scaledColor + - (y0 * (SplashBitmapRowSize)scaledWidth + x0) * nComps; - Guchar *p10 = scaledColor + - (y0 * (SplashBitmapRowSize)scaledWidth + x1) * nComps; - Guchar *p01 = scaledColor + - (y1 * (SplashBitmapRowSize)scaledWidth + x0) * nComps; - Guchar *p11 = scaledColor + - (y1 * (SplashBitmapRowSize)scaledWidth + x1) * nComps; + Guchar *p00 = scaledColor + (y0 * scaledWidth + x0) * nComps; + Guchar *p10 = scaledColor + (y0 * scaledWidth + x1) * nComps; + Guchar *p01 = scaledColor + (y1 * scaledWidth + x0) * nComps; + Guchar *p11 = scaledColor + (y1 * scaledWidth + x1) * nComps; Guchar *q = colorBuf + (x - xMin) * nComps; for (int i = 0; i < nComps; ++i) { *q++ = (Guchar)(int)(sx0 * (sy0 * (int)*p00++ + sy1 * (int)*p01++) + sx1 * (sy0 * (int)*p10++ + sy1 * (int)*p11++)); } if (srcAlpha) { - p00 = scaledAlpha + (y0 * (SplashBitmapRowSize)scaledWidth + x0); - p10 = scaledAlpha + (y0 * (SplashBitmapRowSize)scaledWidth + x1); - p01 = scaledAlpha + (y1 * (SplashBitmapRowSize)scaledWidth + x0); - p11 = scaledAlpha + (y1 * (SplashBitmapRowSize)scaledWidth + x1); + p00 = scaledAlpha + (y0 * scaledWidth + x0); + p10 = scaledAlpha + (y0 * scaledWidth + x1); + p01 = scaledAlpha + (y1 * scaledWidth + x0); + p11 = scaledAlpha + (y1 * scaledWidth + x1); q = alphaBuf + (x - xMin); *q = (Guchar)(int)(sx0 * (sy0 * (int)*p00 + sy1 * (int)*p01) + sx1 * (sy0 * (int)*p10 + sy1 * (int)*p11)); diff --git a/Build/source/libs/xpdf/xpdf-src/splash/Splash.h b/Build/source/libs/xpdf/xpdf-src/splash/Splash.h index f79a948e045..9622b07fc27 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/Splash.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/Splash.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" #include "SplashClip.h" @@ -421,7 +425,7 @@ private: SplashError fillWithPattern(SplashPath *path, GBool eo, SplashPattern *pattern, SplashCoord alpha); SplashPath *tweakFillPath(SplashPath *path); - GBool pathAllOutside(SplashPath *path, GBool stroke); + GBool pathAllOutside(SplashPath *path); SplashError fillGlyph2(int x0, int y0, SplashGlyphBitmap *glyph); void getImageBounds(SplashCoord xyMin, SplashCoord xyMax, int *xyMinI, int *xyMaxI); diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc index 3870f7a4808..db341d7c733 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h index db9f2f4b2cb..54975a377a2 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include #include // older compilers won't define SIZE_MAX in stdint.h without this diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc index 4b491aa019d..bf7b802cf0d 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" @@ -206,7 +210,7 @@ SplashError SplashClip::clipToPath(SplashPath *path, SplashCoord *matrix, xPath = new SplashXPath(path, matrix, flatness, gTrue, enablePathSimplification, - strokeAdjust, NULL); + strokeAdjust); // check for an empty path if (xPath->length == 0) { diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h index 093c65c12c4..fb86ed8fd72 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" #include "SplashMath.h" @@ -96,9 +100,6 @@ public: // Get the number of arbitrary paths used by the clip region. int getNumPaths(); - // Return true if the clip path is a simple rectangle. - GBool getIsSimple() { return isSimple; } - private: SplashClip(SplashClip *clip); @@ -109,11 +110,10 @@ private: hardXMax, hardYMax; // [hardXMin, hardXMax), [hardYMin, hardYMax) SplashCoord xMin, yMin, // current clip bounding rectangle - xMax, yMax; - - int xMinI, yMinI, // integer clip bounding rectangle - xMaxI, yMaxI; // (these coordinates are adjusted if + xMax, yMax; // (these coordinates may be adjusted if // stroke adjustment is enabled) + + int xMinI, yMinI, xMaxI, yMaxI; GBool intBoundsValid; // true if xMinI, etc. are valid GBool intBoundsStrokeAdjust; // value of strokeAdjust used to compute // xMinI, etc. diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc index 79849e63cfe..91481444bca 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc @@ -10,6 +10,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include FT_OUTLINE_H #include FT_SIZES_H diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h index f7254b23d9f..ac08b007747 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h @@ -13,6 +13,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include #include FT_FREETYPE_H #include "SplashFont.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc index 4b995869f24..33939541051 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc @@ -10,6 +10,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #ifndef _WIN32 # include diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h index e6612e13a18..24db3c6cdba 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h @@ -13,6 +13,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include #include FT_FREETYPE_H #include "gtypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc index b76e5430aef..b5fd02af4a0 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc @@ -10,6 +10,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h index 3720d0501ac..3a6b9b7aa43 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h @@ -13,6 +13,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include #include FT_FREETYPE_H #include "SplashFontFile.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc index eb02c67664c..2fcd83d1266 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h index 3612924a6a4..2bb96545867 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" #include "SplashMath.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc index 70338a84666..81afe0cd914 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #ifndef _WIN32 diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h index 99d7b1b2b94..59adb95858a 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" class GString; class GList; diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc index 8d846a9376a..2d260e38239 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #ifndef _WIN32 # include diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h index 72c51b84014..133e6ab87dc 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc index 2c03cf10e83..27f52031d50 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "SplashFontFileID.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h index c4a0d7efa9d..384018a2f3a 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc index ff993d5a8ac..792166715e5 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h index 648b3208073..b5732b8b408 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc index 344a449830e..0c5b5093fd5 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "SplashMath.h" #include "SplashScreen.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h index 45a9dcdc6ba..fcbe21d31cb 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class SplashScreen; diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc index 04286836cc2..9993edc2a38 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #if HAVE_STD_SORT diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h index 9edf8e88e7a..560e2759d82 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc index e0139fda393..7fc510439b1 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h index 695db28b610..be64b472333 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class SplashPattern; diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc index 72e8afd4706..4c77765723e 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #if HAVE_STD_SORT @@ -17,7 +21,6 @@ #include "gmempp.h" #include "SplashMath.h" #include "SplashPath.h" -#include "SplashClip.h" #include "SplashXPath.h" //------------------------------------------------------------------------ @@ -80,8 +83,7 @@ void SplashXPath::clampCoords(SplashCoord *x, SplashCoord *y) { SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix, SplashCoord flatness, GBool closeSubpaths, GBool simplify, - SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip) { + SplashStrokeAdjustMode strokeAdjMode) { SplashXPathPoint *pts; SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xsp, ysp, t; int curSubpath, firstSegInSubpath, i; @@ -97,7 +99,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix, //--- do stroke adjustment if (path->hints) { adjusted = strokeAdjust(pts, path->hints, path->hintsLength, - strokeAdjMode, clip); + strokeAdjMode); } else { adjusted = gFalse; } @@ -225,8 +227,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix, GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts, SplashPathHint *hints, int nHints, - SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip) { + SplashStrokeAdjustMode strokeAdjMode) { SplashXPathAdjust *adjusts, *adjust; SplashPathHint *hint; SplashCoord x0, y0, x1, y1, x2, y2, x3, y3; @@ -237,28 +238,6 @@ GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts, adjusted = gFalse; - // With CAD-mode stroke adjustment, and a simple rectangular clip - // region, stroke-adjusted edges that fall slightly outside the clip - // region are adjusted back inside the clip region. This avoids - // problems with narrow lines in slightly mismatched clip - // rectangles, which appear to be generated somewhat commonly by - // buggy CAD software. (Note: [clip] is NULL when called to build a - // clip path.) - GBool clipTweak = clip && clip->getIsSimple() && - strokeAdjMode == splashStrokeAdjustCAD; - SplashCoord cx0 = 0, cx1 = 0, cy0 = 0, cy1 = 0; - int cxi0 = 0, cxi1 = 0, cyi0 = 0, cyi1 = 0; - if (clipTweak) { - cx0 = clip->getXMin(); - cx1 = clip->getXMax(); - cy0 = clip->getYMin(); - cy1 = clip->getYMax(); - cxi0 = clip->getXMinI(strokeAdjMode); - cxi1 = clip->getXMaxI(strokeAdjMode); - cyi0 = clip->getYMinI(strokeAdjMode); - cyi1 = clip->getYMaxI(strokeAdjMode); - } - // set up the stroke adjustment hints adjusts = (SplashXPathAdjust *)gmallocn(nHints, sizeof(SplashXPathAdjust)); for (i = 0; i < nHints; ++i) { @@ -303,32 +282,6 @@ GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts, adjusts[i].x1a = adj1 - d; adjusts[i].x1b = adj1 + d; splashStrokeAdjust(adj0, adj1, &xi0, &xi1, strokeAdjMode, w); - if (clipTweak) { - SplashCoord c0, c1; - int ci0, ci1; - if (adjusts[i].vert) { - c0 = cx0; - c1 = cx1; - ci0 = cxi0; - ci1 = cxi1; - } else { - c0 = cy0; - c1 = cy1; - ci0 = cyi0; - ci1 = cyi1; - } - if (adj0 < c0 && c0 < adj1 && adj1 < c1 && - adj1 - c0 > (adj1 - adj0) * 0.2 && - xi1 <= ci0) { - xi0 = ci0; - xi1 = xi0 + 1; - } else if (c0 < adj0 && adj0 < c1 && c1 < adj1 && - c1 - adj0 > (adj1 - adj0) * 0.2 && - ci1 < xi0) { - xi0 = ci1; - xi1 = ci1 + 1; - } - } adjusts[i].x0 = (SplashCoord)xi0; // the "minus epsilon" thing here is needed when vector // antialiasing is turned off -- otherwise stroke adjusted lines diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h index 3318866a16e..82d7889c447 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h @@ -11,10 +11,13 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class SplashPath; -class SplashClip; struct SplashXPathPoint; struct SplashPathHint; @@ -91,8 +94,7 @@ public: // subpaths. SplashXPath(SplashPath *path, SplashCoord *matrix, SplashCoord flatness, GBool closeSubpaths, - GBool simplify, SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip); + GBool simplify, SplashStrokeAdjustMode strokeAdjMode); // Copy an expanded path. SplashXPath *copy() { return new SplashXPath(this); } @@ -112,8 +114,7 @@ private: SplashCoord *xo, SplashCoord *yo); GBool strokeAdjust(SplashXPathPoint *pts, SplashPathHint *hints, int nHints, - SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip); + SplashStrokeAdjustMode strokeAdjMode); void grow(int nSegs); void addCurve(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1, diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc index 6477abf85c3..3f167b8b311 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #if HAVE_STD_SORT diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h index decfc50aa7c..39cc0eb022a 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" #include "SplashXPath.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc index 33534dafd60..7b2b9855669 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" @@ -339,12 +343,8 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { AcroForm *acroForm; AcroFormField *field; Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2; - char *touchedObjs; int pageNum, i, j; - touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects()); - memset(touchedObjs, 0, docA->getXRef()->getNumObjects()); - // this is the normal case: acroFormObj is a dictionary, as expected if (acroFormObjA->isDict()) { acroForm = new AcroForm(docA, acroFormObjA); @@ -372,12 +372,11 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { } obj1.free(); delete acroForm; - gfree(touchedObjs); return NULL; } for (i = 0; i < obj1.arrayGetLength(); ++i) { obj1.arrayGetNF(i, &obj2); - acroForm->scanField(&obj2, touchedObjs); + acroForm->scanField(&obj2); obj2.free(); } obj1.free(); @@ -401,7 +400,7 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { annotRef.fetch(acroForm->doc->getXRef(), &annotObj); if (annotObj.isDict()) { if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) { - acroForm->scanField(&annotRef, touchedObjs); + acroForm->scanField(&annotRef); } obj1.free(); } @@ -432,7 +431,7 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { annotRef.fetch(acroForm->doc->getXRef(), &annotObj); if (annotObj.isDict()) { if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) { - acroForm->scanField(&annotRef, touchedObjs); + acroForm->scanField(&annotRef); } obj1.free(); } @@ -450,8 +449,6 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { } } - gfree(touchedObjs); - return acroForm; } @@ -515,22 +512,12 @@ int AcroForm::lookupAnnotPage(Object *annotRef) { return 0; } -void AcroForm::scanField(Object *fieldRef, char *touchedObjs) { +void AcroForm::scanField(Object *fieldRef) { AcroFormField *field; Object fieldObj, kidsObj, kidRef, kidObj, subtypeObj; GBool isTerminal; int i; - // check for an object loop - if (fieldRef->isRef()) { - if (fieldRef->getRefNum() < 0 || - fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() || - touchedObjs[fieldRef->getRefNum()]) { - return; - } - touchedObjs[fieldRef->getRefNum()] = 1; - } - fieldRef->fetch(doc->getXRef(), &fieldObj); if (!fieldObj.isDict()) { error(errSyntaxError, -1, "AcroForm field object is wrong type"); @@ -558,7 +545,7 @@ void AcroForm::scanField(Object *fieldRef, char *touchedObjs) { if (!isTerminal) { for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) { kidsObj.arrayGetNF(i, &kidRef); - scanField(&kidRef, touchedObjs); + scanField(&kidRef); kidRef.free(); } } @@ -2046,18 +2033,21 @@ void AcroFormField::drawText(GString *text, GString *da, GfxFontDict *fontDict, wMax = dx - 2 * border - 4; +#if 1 //~tmp // this is a kludge that appears to match Adobe's behavior if (height > 15) { topBorder = 5; } else { topBorder = 2; } +#else + topBorder = 5; +#endif // compute font autosize if (fontSize == 0) { for (fontSize = 10; fontSize > 1; --fontSize) { yy = dy - topBorder; - w = 0; i = 0; while (i < text2->getLength()) { getNextLine(text2, i, font, fontSize, wMax, &j, &w, &k); @@ -3193,7 +3183,7 @@ GBool AcroFormField::unicodeStringEqual(Unicode *u, int unicodeLength, return gFalse; } for (int i = 0; i < unicodeLength; ++i) { - if ((Unicode)(s->getChar(i) & 0xff) != u[i]) { + if ((s->getChar(i) & 0xff) != u[i]) { return gFalse; } } @@ -3203,7 +3193,7 @@ GBool AcroFormField::unicodeStringEqual(Unicode *u, int unicodeLength, GBool AcroFormField::unicodeStringEqual(Unicode *u, int unicodeLength, const char *s) { for (int i = 0; i < unicodeLength; ++i) { - if (!s[i] || (Unicode)(s[i] & 0xff) != u[i]) { + if (!s[i] || (s[i] & 0xff) != u[i]) { return gFalse; } } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h index 0e922d17afc..7678d46dbc8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class TextString; class Gfx; class GfxFont; @@ -43,7 +47,7 @@ private: AcroForm(PDFDoc *docA, Object *acroFormObjA); void buildAnnotPageList(Catalog *catalog); int lookupAnnotPage(Object *annotRef); - void scanField(Object *fieldRef, char *touchedObjs); + void scanField(Object *fieldRef); PDFDoc *doc; Object acroFormObj; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc index 465bda6194a..82ef600be73 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc @@ -2,15 +2,18 @@ // // Annot.cc // -// Copyright 2000-2022 Glyph & Cog, LLC +// Copyright 2000-2003 Glyph & Cog, LLC // //======================================================================== #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include -#include #include "gmem.h" #include "gmempp.h" #include "GList.h" @@ -275,8 +278,6 @@ Annot::Annot(PDFDoc *docA, Dict *dict, Ref *refA) { obj3.free(); } else if (obj2.isRef()) { obj2.copy(&appearance); - } else if (obj2.isStream()) { - obj2.copy(&appearance); } obj1.free(); obj2.free(); @@ -305,48 +306,29 @@ Annot::~Annot() { ocObj.free(); } -void Annot::generateAnnotAppearance(Object *annotObj) { +void Annot::generateAnnotAppearance() { Object obj; - appearance.fetch(doc->getXRef(), &obj); - GBool alreadyHaveAppearance = obj.isStream(); - obj.free(); - if (alreadyHaveAppearance) { - return; - } - if (!type || (type->cmp("Line") && - type->cmp("PolyLine") && - type->cmp("Polygon") && - type->cmp("FreeText"))) { - return; - } - - Object annotObj2; - if (!annotObj) { - getObject(&annotObj2); - annotObj = &annotObj2; - } - if (!annotObj->isDict()) { - annotObj2.free(); - return; - } - - if (!type->cmp("Line")) { - generateLineAppearance(annotObj); - } else if (!type->cmp("PolyLine")) { - generatePolyLineAppearance(annotObj); - } else if (!type->cmp("Polygon")) { - generatePolygonAppearance(annotObj); - } else if (!type->cmp("FreeText")) { - generateFreeTextAppearance(annotObj); + appearance.fetch(doc->getXRef(), &obj); + if (!obj.isStream()) { + if (type) { + if (!type->cmp("Line")) { + generateLineAppearance(); + } else if (!type->cmp("PolyLine")) { + generatePolyLineAppearance(); + } else if (!type->cmp("Polygon")) { + generatePolygonAppearance(); + } else if (!type->cmp("FreeText")) { + generateFreeTextAppearance(); + } + } } - - annotObj2.free(); + obj.free(); } //~ this doesn't draw the caption -void Annot::generateLineAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generateLineAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; MemStream *appearStream; double x1, y1, x2, y2, dx, dy, len, w; double lx1, ly1, lx2, ly2; @@ -357,10 +339,15 @@ void Annot::generateLineAppearance(Object *annotObj) { AnnotLineEndType lineEnd1, lineEnd2; GBool fill; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -371,7 +358,7 @@ void Annot::generateLineAppearance(Object *annotObj) { setLineStyle(borderStyle, &w); setStrokeColor(borderStyle->getColor(), borderStyle->getNumColorComps()); fill = gFalse; - if (annotObj->dictLookup("IC", &obj1)->isArray()) { + if (annotObj.dictLookup("IC", &obj1)->isArray()) { if (setFillColor(&obj1)) { fill = gTrue; } @@ -379,14 +366,14 @@ void Annot::generateLineAppearance(Object *annotObj) { obj1.free(); //----- get line properties - if (annotObj->dictLookup("L", &obj1)->isArray() && + if (annotObj.dictLookup("L", &obj1)->isArray() && obj1.arrayGetLength() == 4) { if (obj1.arrayGet(0, &obj2)->isNum()) { x1 = obj2.getNum(); } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); if (obj1.arrayGet(1, &obj2)->isNum()) { @@ -394,7 +381,7 @@ void Annot::generateLineAppearance(Object *annotObj) { } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); if (obj1.arrayGet(2, &obj2)->isNum()) { @@ -402,7 +389,7 @@ void Annot::generateLineAppearance(Object *annotObj) { } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); if (obj1.arrayGet(3, &obj2)->isNum()) { @@ -410,16 +397,16 @@ void Annot::generateLineAppearance(Object *annotObj) { } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); } else { obj1.free(); - return; + goto err1; } obj1.free(); lineEnd1 = lineEnd2 = annotLineEndNone; - if (annotObj->dictLookup("LE", &obj1)->isArray() && + if (annotObj.dictLookup("LE", &obj1)->isArray() && obj1.arrayGetLength() == 2) { lineEnd1 = parseLineEndType(obj1.arrayGet(0, &obj2)); obj2.free(); @@ -427,19 +414,19 @@ void Annot::generateLineAppearance(Object *annotObj) { obj2.free(); } obj1.free(); - if (annotObj->dictLookup("LL", &obj1)->isNum()) { + if (annotObj.dictLookup("LL", &obj1)->isNum()) { leaderLen = obj1.getNum(); } else { leaderLen = 0; } obj1.free(); - if (annotObj->dictLookup("LLE", &obj1)->isNum()) { + if (annotObj.dictLookup("LLE", &obj1)->isNum()) { leaderExtLen = obj1.getNum(); } else { leaderExtLen = 0; } obj1.free(); - if (annotObj->dictLookup("LLO", &obj1)->isNum()) { + if (annotObj.dictLookup("LLO", &obj1)->isNum()) { leaderOffLen = obj1.getNum(); } else { leaderOffLen = 0; @@ -526,19 +513,27 @@ void Annot::generateLineAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + err1: + annotObj.free(); } //~ this doesn't handle line ends (arrows) -void Annot::generatePolyLineAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generatePolyLineAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; MemStream *appearStream; double x1, y1, w; int i; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -549,7 +544,7 @@ void Annot::generatePolyLineAppearance(Object *annotObj) { setLineStyle(borderStyle, &w); setStrokeColor(borderStyle->getColor(), borderStyle->getNumColorComps()); // fill = gFalse; - // if (annotObj->dictLookup("IC", &obj1)->isArray()) { + // if (annotObj.dictLookup("IC", &obj1)->isArray()) { // if (setFillColor(&obj1)) { // fill = gTrue; // } @@ -557,22 +552,22 @@ void Annot::generatePolyLineAppearance(Object *annotObj) { // obj1.free(); //----- draw line - if (!annotObj->dictLookup("Vertices", &obj1)->isArray()) { + if (!annotObj.dictLookup("Vertices", &obj1)->isArray()) { obj1.free(); - return; + goto err1; } for (i = 0; i+1 < obj1.arrayGetLength(); i += 2) { if (!obj1.arrayGet(i, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } x1 = obj2.getNum(); obj2.free(); if (!obj1.arrayGet(i+1, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } y1 = obj2.getNum(); obj2.free(); @@ -611,18 +606,26 @@ void Annot::generatePolyLineAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + err1: + annotObj.free(); } -void Annot::generatePolygonAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generatePolygonAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; MemStream *appearStream; double x1, y1; int i; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -630,30 +633,30 @@ void Annot::generatePolygonAppearance(Object *annotObj) { obj1.free(); //----- set fill color - if (!annotObj->dictLookup("IC", &obj1)->isArray() || + if (!annotObj.dictLookup("IC", &obj1)->isArray() || !setFillColor(&obj1)) { obj1.free(); - return; + goto err1; } obj1.free(); //----- fill polygon - if (!annotObj->dictLookup("Vertices", &obj1)->isArray()) { + if (!annotObj.dictLookup("Vertices", &obj1)->isArray()) { obj1.free(); - return; + goto err1; } for (i = 0; i+1 < obj1.arrayGetLength(); i += 2) { if (!obj1.arrayGet(i, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } x1 = obj2.getNum(); obj2.free(); if (!obj1.arrayGet(i+1, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } y1 = obj2.getNum(); obj2.free(); @@ -692,23 +695,31 @@ void Annot::generatePolygonAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + err1: + annotObj.free(); } //~ this doesn't handle rich text //~ this doesn't handle the callout //~ this doesn't handle the RD field -void Annot::generateFreeTextAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generateFreeTextAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; Object resources, gsResources, fontResources, defaultFont; GString *text, *da; double lineWidth; int quadding, rot; MemStream *appearStream; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -716,19 +727,19 @@ void Annot::generateFreeTextAppearance(Object *annotObj) { obj1.free(); //----- draw the text - if (annotObj->dictLookup("Contents", &obj1)->isString()) { + if (annotObj.dictLookup("Contents", &obj1)->isString()) { text = obj1.getString()->copy(); } else { text = new GString(); } obj1.free(); - if (annotObj->dictLookup("Q", &obj1)->isInt()) { + if (annotObj.dictLookup("Q", &obj1)->isInt()) { quadding = obj1.getInt(); } else { quadding = 0; } obj1.free(); - if (annotObj->dictLookup("DA", &obj1)->isString()) { + if (annotObj.dictLookup("DA", &obj1)->isString()) { da = obj1.getString()->copy(); } else { da = new GString(); @@ -736,7 +747,7 @@ void Annot::generateFreeTextAppearance(Object *annotObj) { obj1.free(); // the "Rotate" field is not defined in the PDF spec, but Acrobat // looks at it - if (annotObj->dictLookup("Rotate", &obj1)->isInt()) { + if (annotObj.dictLookup("Rotate", &obj1)->isInt()) { rot = obj1.getInt(); } else { rot = 0; @@ -786,6 +797,8 @@ void Annot::generateFreeTextAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + annotObj.free(); } void Annot::setLineStyle(AnnotBorderStyle *bs, double *lineWidth) { @@ -1330,193 +1343,106 @@ Object *Annot::getObject(Object *obj) { return obj; } -//------------------------------------------------------------------------ -// PageAnnots -//------------------------------------------------------------------------ - -class PageAnnots { -public: - - PageAnnots(); - ~PageAnnots(); - - GList *annots; // list of annots on the page [Annot] - GBool appearancesGenerated; // set after appearances have been generated -}; - -PageAnnots::PageAnnots() { - annots = new GList(); - appearancesGenerated = gFalse; -} - -PageAnnots::~PageAnnots() { - deleteGList(annots, Annot); -} - //------------------------------------------------------------------------ // Annots //------------------------------------------------------------------------ -Annots::Annots(PDFDoc *docA) { - doc = docA; - pageAnnots = (PageAnnots **)gmallocn(doc->getNumPages(), sizeof(PageAnnots*)); - for (int page = 1; page <= doc->getNumPages(); ++page) { - pageAnnots[page - 1] = NULL; - } - formFieldRefsSize = 0; - formFieldRefs = NULL; -} - -Annots::~Annots() { - for (int page = 1; page <= doc->getNumPages(); ++page) { - delete pageAnnots[page - 1]; - } - gfree(pageAnnots); - gfree(formFieldRefs); -} - -void Annots::loadAnnots(int page) { - if (pageAnnots[page - 1]) { - return; - } - - pageAnnots[page - 1] = new PageAnnots(); - - Object annotsObj; - doc->getCatalog()->getPage(page)->getAnnots(&annotsObj); - if (!annotsObj.isArray()) { - annotsObj.free(); - return; - } - - loadFormFieldRefs(); - - for (int i = 0; i < annotsObj.arrayGetLength(); ++i) { - Object annotObj; - Ref annotRef; - if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) { - annotRef = annotObj.getRef(); - annotObj.free(); - annotsObj.arrayGet(i, &annotObj); - } else { - annotRef.num = annotRef.gen = -1; - } - if (!annotObj.isDict()) { - annotObj.free(); - continue; - } - - // skip any annotations which are used as AcroForm fields -- - // they'll be rendered by the AcroForm module - if (annotRef.num >= 0 && annotRef.num < formFieldRefsSize && - formFieldRefs[annotRef.num]) { - annotObj.free(); - continue; - } - - Annot *annot = new Annot(doc, annotObj.getDict(), &annotRef); - annotObj.free(); - if (annot->isOk()) { - pageAnnots[page - 1]->annots->append(annot); - } else { - delete annot; - } - } - - annotsObj.free(); -} - -// Build a set of object refs for AcroForm fields. -void Annots::loadFormFieldRefs() { - if (formFieldRefs) { - return; - } - - AcroForm *form = doc->getCatalog()->getForm(); - if (!form) { - return; - } +Annots::Annots(PDFDoc *docA, Object *annotsObj) { + Annot *annot; + Object obj1, obj2; + Ref ref; + GBool drawWidgetAnnots; + int size; + int i; - int newFormFieldRefsSize = 256; - for (int i = 0; i < form->getNumFields(); ++i) { - AcroFormField *field = form->getField(i); - Object fieldRef; - field->getFieldRef(&fieldRef); - if (fieldRef.getRefNum() >= formFieldRefsSize) { - while (fieldRef.getRefNum() >= newFormFieldRefsSize && - newFormFieldRefsSize <= INT_MAX / 2) { - newFormFieldRefsSize *= 2; - } - if (fieldRef.getRefNum() >= newFormFieldRefsSize) { - continue; + doc = docA; + annots = NULL; + size = 0; + nAnnots = 0; + + if (annotsObj->isArray()) { + // Kludge: some PDF files define an empty AcroForm, but still + // include Widget-type annotations -- in that case, we want to + // draw the widgets (since the form code won't). This really + // ought to look for Widget-type annotations that are not included + // in any form field. + drawWidgetAnnots = !doc->getCatalog()->getForm() || + doc->getCatalog()->getForm()->getNumFields() == 0; + for (i = 0; i < annotsObj->arrayGetLength(); ++i) { + if (annotsObj->arrayGetNF(i, &obj1)->isRef()) { + ref = obj1.getRef(); + obj1.free(); + annotsObj->arrayGet(i, &obj1); + } else { + ref.num = ref.gen = -1; } - formFieldRefs = (char *)grealloc(formFieldRefs, newFormFieldRefsSize); - for (int j = formFieldRefsSize; j < newFormFieldRefsSize; ++j) { - formFieldRefs[j] = (char)0; + if (obj1.isDict()) { + if (drawWidgetAnnots || + !obj1.dictLookup("Subtype", &obj2)->isName("Widget")) { + annot = new Annot(doc, obj1.getDict(), &ref); + if (annot->isOk()) { + if (nAnnots >= size) { + size += 16; + annots = (Annot **)greallocn(annots, size, sizeof(Annot *)); + } + annots[nAnnots++] = annot; + } else { + delete annot; + } + } + obj2.free(); } - formFieldRefsSize = newFormFieldRefsSize; + obj1.free(); } - formFieldRefs[fieldRef.getRefNum()] = (char)1; - fieldRef.free(); } } -int Annots::getNumAnnots(int page) { - loadAnnots(page); - return pageAnnots[page - 1]->annots->getLength(); -} +Annots::~Annots() { + int i; -Annot *Annots::getAnnot(int page, int idx) { - loadAnnots(page); - return (Annot *)pageAnnots[page - 1]->annots->get(idx); + for (i = 0; i < nAnnots; ++i) { + delete annots[i]; + } + gfree(annots); } -Annot *Annots::find(int page, double x, double y) { - loadAnnots(page); - PageAnnots *pa = pageAnnots[page - 1]; - for (int i = pa->annots->getLength() - 1; i >= 0; --i) { - Annot *annot = (Annot *)pa->annots->get(i); - if (annot->inRect(x, y)) { - return annot; +Annot *Annots::find(double x, double y) { + int i; + + for (i = nAnnots - 1; i >= 0; --i) { + if (annots[i]->inRect(x, y)) { + return annots[i]; } } return NULL; } -int Annots::findIdx(int page, double x, double y) { - loadAnnots(page); - PageAnnots *pa = pageAnnots[page - 1]; - for (int i = pa->annots->getLength() - 1; i >= 0; --i) { - Annot *annot = (Annot *)pa->annots->get(i); - if (annot->inRect(x, y)) { +int Annots::findIdx(double x, double y) { + int i; + + for (i = nAnnots - 1; i >= 0; --i) { + if (annots[i]->inRect(x, y)) { return i; } } return -1; } -void Annots::add(int page, Object *annotObj) { - if (!annotObj->isDict()) { - return; - } - Ref annotRef = {-1, -1}; - Annot *annot = new Annot(doc, annotObj->getDict(), &annotRef); - if (annot->isOk()) { - annot->generateAnnotAppearance(annotObj); - pageAnnots[page - 1]->annots->append(annot); - } else { - delete annot; +void Annots::generateAnnotAppearances() { + int i; + + for (i = 0; i < nAnnots; ++i) { + annots[i]->generateAnnotAppearance(); } } -void Annots::generateAnnotAppearances(int page) { - loadAnnots(page); - PageAnnots *pa = pageAnnots[page - 1]; - if (!pa->appearancesGenerated) { - for (int i = 0; i < pa->annots->getLength(); ++i) { - Annot *annot = (Annot *)pa->annots->get(i); - annot->generateAnnotAppearance(NULL); +Annot *Annots::findAnnot(Ref *ref) { + int i; + + for (i = 0; i < nAnnots; ++i) { + if (annots[i]->match(ref)) { + return annots[i]; } - pa->appearancesGenerated = gTrue; } + return NULL; } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h index 168061fc262..6ba5ff490da 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h @@ -2,7 +2,7 @@ // // Annot.h // -// Copyright 2000-2022 Glyph & Cog, LLC +// Copyright 2000-2003 Glyph & Cog, LLC // //======================================================================== @@ -11,12 +11,15 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class XRef; class Catalog; class Gfx; class GfxFontDict; class PDFDoc; -class PageAnnots; //------------------------------------------------------------------------ // AnnotBorderStyle @@ -102,14 +105,14 @@ public: GBool match(Ref *refA) { return ref.num == refA->num && ref.gen == refA->gen; } - void generateAnnotAppearance(Object *annotObj); + void generateAnnotAppearance(); private: - void generateLineAppearance(Object *annotObj); - void generatePolyLineAppearance(Object *annotObj); - void generatePolygonAppearance(Object *annotObj); - void generateFreeTextAppearance(Object *annotObj); + void generateLineAppearance(); + void generatePolyLineAppearance(); + void generatePolygonAppearance(); + void generateFreeTextAppearance(); void setLineStyle(AnnotBorderStyle *bs, double *lineWidth); void setStrokeColor(double *color, int nComps); GBool setFillColor(Object *colorObj); @@ -149,35 +152,34 @@ private: class Annots { public: - Annots(PDFDoc *docA); + // Build a list of Annot objects. + Annots(PDFDoc *docA, Object *annotsObj); ~Annots(); - // Iterate over annotations on a specific page. - int getNumAnnots(int page); - Annot *getAnnot(int page, int idx); + // Iterate through list of annotations. + int getNumAnnots() { return nAnnots; } + Annot *getAnnot(int i) { return annots[i]; } - // If point (,) is in an annotation, return the associated - // annotation (or annotation index); else return NULL (or -1). - Annot *find(int page, double x, double y); - int findIdx(int page, double x, double y); - - // Add an annotation [annotObj] on page [page]. - void add(int page, Object *annotObj); + // If point , is in an annotation, return the associated + // annotation; else return NULL. + Annot *find(double x, double y); + int findIdx(double x, double y); // Generate an appearance stream for any non-form-field annotation - // on the specified page that is missing an appearance. - void generateAnnotAppearances(int page); + // that is missing it. + void generateAnnotAppearances(); private: - void loadAnnots(int page); - void loadFormFieldRefs(); + void scanFieldAppearances(Dict *node, Ref *ref, Dict *parent, + Dict *acroForm); + + Annot *findAnnot(Ref *ref); PDFDoc *doc; - PageAnnots **pageAnnots; // list of annots for each page - int formFieldRefsSize; // number of entries in formFieldRefs[] - char *formFieldRefs; // set of AcroForm field refs + Annot **annots; + int nAnnots; }; #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc index 2771186152a..2bf948ec65c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" @@ -49,7 +53,7 @@ void Array::add(Object *elem) { Object *Array::get(int i, Object *obj, int recursion) { if (i < 0 || i >= length) { -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM abort(); #else return obj->initNull(); @@ -60,7 +64,7 @@ Object *Array::get(int i, Object *obj, int recursion) { Object *Array::getNF(int i, Object *obj) { if (i < 0 || i >= length) { -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM abort(); #else return obj->initNull(); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h index 9a887f41e46..8d10eadc8dd 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #if MULTITHREADED #include "GMutex.h" #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc index 51c2d33b3f9..d2f875e45fd 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h index 042e4e0d634..f24cbf98f9f 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" struct BuiltinFont; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc index c898ac5737d..12632c5992c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h index 5731ef09f01..55692b4f337 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "CharTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc index 7a9b0701ca3..ddcbad55f07 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -522,10 +526,7 @@ GBool Catalog::readPageTree(Object *catDict) { // because other code tries to fetch pages 1 through n. // In both cases: ignore the given page count and scan the tree // instead. - char *touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); - numPages = countPageTree(&topPagesRef, touchedObjs); - gfree(touchedObjs); + numPages = countPageTree(&topPagesObj); } } else { // assume we got a Page node instead of a Pages node @@ -552,53 +553,30 @@ GBool Catalog::readPageTree(Object *catDict) { return gTrue; } -int Catalog::countPageTree(Object *pagesNodeRef, char *touchedObjs) { - // check for invalid reference - if (pagesNodeRef->isRef() && - (pagesNodeRef->getRefNum() < 0 || - pagesNodeRef->getRefNum() >= xref->getNumObjects())) { +int Catalog::countPageTree(Object *pagesObj) { + Object kids, kid; + int n, n2, i; + + if (!pagesObj->isDict()) { return 0; } - - // check for a page tree loop; fetch the node object - Object pagesNode; - if (pagesNodeRef->isRef()) { - if (touchedObjs[pagesNodeRef->getRefNum()]) { - error(errSyntaxError, -1, "Loop in Pages tree"); - return 0; - } - touchedObjs[pagesNodeRef->getRefNum()] = 1; - xref->fetch(pagesNodeRef->getRefNum(), pagesNodeRef->getRefGen(), - &pagesNode); - } else { - pagesNodeRef->copy(&pagesNode); - } - - // count the subtree - int n = 0; - if (pagesNode.isDict()) { - Object kids; - if (pagesNode.dictLookup("Kids", &kids)->isArray()) { - for (int i = 0; i < kids.arrayGetLength(); ++i) { - Object kid; - kids.arrayGetNF(i, &kid); - int n2 = countPageTree(&kid, touchedObjs); - if (n2 < INT_MAX - n) { - n += n2; - } else { - error(errSyntaxError, -1, "Page tree contains too many pages"); - n = INT_MAX; - } - kid.free(); + if (pagesObj->dictLookup("Kids", &kids)->isArray()) { + n = 0; + for (i = 0; i < kids.arrayGetLength(); ++i) { + kids.arrayGet(i, &kid); + n2 = countPageTree(&kid); + if (n2 < INT_MAX - n) { + n += n2; + } else { + error(errSyntaxError, -1, "Page tree contains too many pages"); + n = INT_MAX; } - } else { - n = 1; + kid.free(); } - kids.free(); + } else { + n = 1; } - - pagesNode.free(); - + kids.free(); return n; } @@ -760,55 +738,37 @@ void Catalog::readEmbeddedFileList(Dict *catDict) { Object obj1, obj2; char *touchedObjs; - touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); - // read the embedded file name tree if (catDict->lookup("Names", &obj1)->isDict()) { - obj1.dictLookupNF("EmbeddedFiles", &obj2); - readEmbeddedFileTree(&obj2, touchedObjs); + if (obj1.dictLookup("EmbeddedFiles", &obj2)->isDict()) { + readEmbeddedFileTree(&obj2); + } obj2.free(); } obj1.free(); // look for file attachment annotations + touchedObjs = (char *)gmalloc(xref->getNumObjects()); + memset(touchedObjs, 0, xref->getNumObjects()); readFileAttachmentAnnots(catDict->lookupNF("Pages", &obj1), touchedObjs); obj1.free(); - gfree(touchedObjs); } -void Catalog::readEmbeddedFileTree(Object *nodeRef, char *touchedObjs) { - Object node, kidsObj, kidObj; +void Catalog::readEmbeddedFileTree(Object *node) { + Object kidsObj, kidObj; Object namesObj, nameObj, fileSpecObj; int i; - // check for an object loop - if (nodeRef->isRef()) { - if (nodeRef->getRefNum() < 0 || - nodeRef->getRefNum() >= xref->getNumObjects() || - touchedObjs[nodeRef->getRefNum()]) { - return; - } - touchedObjs[nodeRef->getRefNum()] = 1; - xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node); - } else { - nodeRef->copy(&node); - } - - if (!node.isDict()) { - node.free(); - return; - } - - if (node.dictLookup("Kids", &kidsObj)->isArray()) { + if (node->dictLookup("Kids", &kidsObj)->isArray()) { for (i = 0; i < kidsObj.arrayGetLength(); ++i) { - kidsObj.arrayGetNF(i, &kidObj); - readEmbeddedFileTree(&kidObj, touchedObjs); + if (kidsObj.arrayGet(i, &kidObj)->isDict()) { + readEmbeddedFileTree(&kidObj); + } kidObj.free(); } } else { - if (node.dictLookup("Names", &namesObj)->isArray()) { + if (node->dictLookup("Names", &namesObj)->isArray()) { for (i = 0; i+1 < namesObj.arrayGetLength(); ++i) { namesObj.arrayGet(i, &nameObj); namesObj.arrayGet(i+1, &fileSpecObj); @@ -820,8 +780,6 @@ void Catalog::readEmbeddedFileTree(Object *nodeRef, char *touchedObjs) { namesObj.free(); } kidsObj.free(); - - node.free(); } void Catalog::readFileAttachmentAnnots(Object *pageNodeRef, @@ -830,9 +788,8 @@ void Catalog::readFileAttachmentAnnots(Object *pageNodeRef, int i; // check for an invalid object reference (e.g., in a damaged PDF file) - if (pageNodeRef->isRef() && - (pageNodeRef->getRefNum() < 0 || - pageNodeRef->getRefNum() >= xref->getNumObjects())) { + if (pageNodeRef->getRefNum() < 0 || + pageNodeRef->getRefNum() >= xref->getNumObjects()) { return; } @@ -944,14 +901,10 @@ Object *Catalog::getEmbeddedFileStreamObj(int idx, Object *strObj) { void Catalog::readPageLabelTree(Object *root) { PageLabelNode *label0, *label1; - char *touchedObjs; int i; - touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); pageLabels = new GList(); - readPageLabelTree2(root, touchedObjs); - gfree(touchedObjs); + readPageLabelTree2(root); if (pageLabels->getLength() == 0) { deleteGList(pageLabels, PageLabelNode); @@ -969,29 +922,15 @@ void Catalog::readPageLabelTree(Object *root) { label0->lastPage = numPages; } -void Catalog::readPageLabelTree2(Object *nodeRef, char *touchedObjs) { - Object node, nums, num, labelObj, kids, kid; +void Catalog::readPageLabelTree2(Object *node) { + Object nums, num, labelObj, kids, kid; int i; - // check for an object loop - if (nodeRef->isRef()) { - if (nodeRef->getRefNum() < 0 || - nodeRef->getRefNum() >= xref->getNumObjects() || - touchedObjs[nodeRef->getRefNum()]) { - return; - } - touchedObjs[nodeRef->getRefNum()] = 1; - xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node); - } else { - nodeRef->copy(&node); - } - - if (!node.isDict()) { - node.free(); + if (!node->isDict()) { return; } - if (node.dictLookup("Nums", &nums)->isArray()) { + if (node->dictLookup("Nums", &nums)->isArray()) { for (i = 0; i < nums.arrayGetLength() - 1; i += 2) { if (nums.arrayGet(i, &num)->isInt()) { if (nums.arrayGet(i+1, &labelObj)->isDict()) { @@ -1005,16 +944,14 @@ void Catalog::readPageLabelTree2(Object *nodeRef, char *touchedObjs) { } nums.free(); - if (node.dictLookup("Kids", &kids)->isArray()) { + if (node->dictLookup("Kids", &kids)->isArray()) { for (i = 0; i < kids.arrayGetLength(); ++i) { - kids.arrayGetNF(i, &kid); - readPageLabelTree2(&kid, touchedObjs); + kids.arrayGet(i, &kid); + readPageLabelTree2(&kid); kid.free(); } } kids.free(); - - node.free(); } TextString *Catalog::getPageLabel(int pageNum) { @@ -1258,130 +1195,3 @@ GBool Catalog::convertPageLabelToInt(TextString *pageLabel, int prefixLength, } return gFalse; } - -GBool Catalog::usesJavaScript() { - Object catDict; - if (!xref->getCatalog(&catDict)->isDict()) { - catDict.free(); - return gFalse; - } - - GBool usesJS = gFalse; - - // check for Catalog.Names.JavaScript - Object namesObj; - if (catDict.dictLookup("Names", &namesObj)->isDict()) { - Object jsNamesObj; - namesObj.dictLookup("JavaScript", &jsNamesObj); - if (jsNamesObj.isDict()) { - usesJS = gTrue; - } - jsNamesObj.free(); - } - namesObj.free(); - - // look for JavaScript actionas in Page.AA - if (!usesJS) { - char *touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); - Object pagesObj; - usesJS = scanPageTreeForJavaScript(catDict.dictLookupNF("Pages", &pagesObj), - touchedObjs); - pagesObj.free(); - gfree(touchedObjs); - } - - catDict.free(); - - return usesJS; -} - -GBool Catalog::scanPageTreeForJavaScript(Object *pageNodeRef, - char *touchedObjs) { - // check for an invalid object reference (e.g., in a damaged PDF file) - if (pageNodeRef->isRef() && - (pageNodeRef->getRefNum() < 0 || - pageNodeRef->getRefNum() >= xref->getNumObjects())) { - return gFalse; - } - - // check for a page tree loop - Object pageNode; - if (pageNodeRef->isRef()) { - if (touchedObjs[pageNodeRef->getRefNum()]) { - return gFalse; - } - touchedObjs[pageNodeRef->getRefNum()] = 1; - xref->fetch(pageNodeRef->getRefNum(), pageNodeRef->getRefGen(), &pageNode); - } else { - pageNodeRef->copy(&pageNode); - } - - // scan the page tree node - GBool usesJS = gFalse; - if (pageNode.isDict()) { - Object kids; - if (pageNode.dictLookup("Kids", &kids)->isArray()) { - for (int i = 0; i < kids.arrayGetLength() && !usesJS; ++i) { - Object kid; - if (scanPageTreeForJavaScript(kids.arrayGetNF(i, &kid), touchedObjs)) { - usesJS = gTrue; - } - kid.free(); - } - } else { - - // scan Page.AA - Object pageAA; - if (pageNode.dictLookup("AA", &pageAA)->isDict()) { - if (scanAAForJavaScript(&pageAA)) { - usesJS = gTrue; - } - } - pageAA.free(); - - // scanPage.Annots - if (!usesJS) { - Object annots; - if (pageNode.dictLookup("Annots", &annots)->isArray()) { - for (int i = 0; i < annots.arrayGetLength() && !usesJS; ++i) { - Object annot; - if (annots.arrayGet(i, &annot)->isDict()) { - Object annotAA; - if (annot.dictLookup("AA", &annotAA)->isDict()) { - if (scanAAForJavaScript(&annotAA)) { - usesJS = gTrue; - } - } - annotAA.free(); - } - annot.free(); - } - } - annots.free(); - } - } - kids.free(); - } - - pageNode.free(); - - return usesJS; -} - -GBool Catalog::scanAAForJavaScript(Object *aaObj) { - GBool usesJS = gFalse; - for (int i = 0; i < aaObj->dictGetLength() && !usesJS; ++i) { - Object action; - if (aaObj->dictGetVal(i, &action)->isDict()) { - Object js; - if (!action.dictLookupNF("JS", &js)->isNull()) { - usesJS = gTrue; - } - js.free(); - } - action.free(); - } - return usesJS; -} - diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h index 91597e54137..0acdd2d1574 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #if MULTITHREADED #include "GMutex.h" #endif @@ -114,9 +118,6 @@ public: Object *getViewerPreferences() { return &viewerPrefs; } - // Return true if the document uses JavaScript. - GBool usesJavaScript(); - private: PDFDoc *doc; @@ -145,23 +146,21 @@ private: Object *findDestInTree(Object *tree, GString *name, Object *obj); GBool readPageTree(Object *catDict); - int countPageTree(Object *pagesNodeRef, char *touchedObjs); + int countPageTree(Object *pagesObj); void loadPage(int pg); void loadPage2(int pg, int relPg, PageTreeNode *node); void readEmbeddedFileList(Dict *catDict); - void readEmbeddedFileTree(Object *nodeRef, char *touchedObjs); + void readEmbeddedFileTree(Object *node); void readFileAttachmentAnnots(Object *pageNodeRef, char *touchedObjs); void readEmbeddedFile(Object *fileSpec, Object *name1); void readPageLabelTree(Object *root); - void readPageLabelTree2(Object *node, char *touchedObjs); + void readPageLabelTree2(Object *node); PageLabelNode *findPageLabel(int pageNum); GString *makeRomanNumeral(int num, GBool uppercase); GString *makeLetterLabel(int num, GBool uppercase); GBool convertPageLabelToInt(TextString *pageLabel, int prefixLength, char style, int *n); - GBool scanPageTreeForJavaScript(Object *pageNodeRef, char *touchedObjs); - GBool scanAAForJavaScript(Object *aaObj); }; #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc index 83720069e64..0a2100fde9b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" @@ -270,18 +274,7 @@ GBool CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data, pst = new PSTokenizer(getCharFunc, data); pst->getToken(tok1, sizeof(tok1), &n1); while (pst->getToken(tok2, sizeof(tok2), &n2)) { - if (!strcmp(tok1, "begincodespacerange")) { - if (globalParams->getIgnoreWrongSizeToUnicode() && - tok2[0] == '<' && tok2[n2 - 1] == '>' && - n2 - 2 != nBits / 4) { - error(errSyntaxWarning, -1, - "Incorrect character size in ToUnicode CMap"); - ok = gFalse; - break; - } - while (pst->getToken(tok1, sizeof(tok1), &n1) && - strcmp(tok1, "endcodespacerange")) ; - } else if (!strcmp(tok2, "usecmap")) { + if (!strcmp(tok2, "usecmap")) { if (tok1[0] == '/') { name = new GString(tok1 + 1); if ((f = globalParams->findToUnicodeFile(name))) { @@ -472,7 +465,6 @@ GBool CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data, pst->getToken(tok1, sizeof(tok1), &n1); } else { strcpy(tok1, tok2); - n1 = n2; } } delete pst; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h index 7bbc97f834e..be9025107aa 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h @@ -13,6 +13,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "CharTypes.h" #if MULTITHREADED diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc index d36626dc344..d4f8d4ec336 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include "gmem.h" #include "gmempp.h" @@ -1488,14 +1492,14 @@ static void sha512(Guchar *msg, int msgLen, Guchar *hash) { SHA512Uint64 H[8]; int blkLen, i; - H[0] = 0x6a09e667f3bcc908ULL; - H[1] = 0xbb67ae8584caa73bULL; - H[2] = 0x3c6ef372fe94f82bULL; - H[3] = 0xa54ff53a5f1d36f1ULL; - H[4] = 0x510e527fade682d1ULL; - H[5] = 0x9b05688c2b3e6c1fULL; - H[6] = 0x1f83d9abfb41bd6bULL; - H[7] = 0x5be0cd19137e2179ULL; + H[0] = 0x6a09e667f3bcc908LL; + H[1] = 0xbb67ae8584caa73bLL; + H[2] = 0x3c6ef372fe94f82bLL; + H[3] = 0xa54ff53a5f1d36f1LL; + H[4] = 0x510e527fade682d1LL; + H[5] = 0x9b05688c2b3e6c1fLL; + H[6] = 0x1f83d9abfb41bd6bLL; + H[7] = 0x5be0cd19137e2179LL; blkLen = 0; for (i = 0; i + 128 <= msgLen; i += 128) { @@ -1554,14 +1558,14 @@ static void sha384(Guchar *msg, int msgLen, Guchar *hash) { SHA512Uint64 H[8]; int blkLen, i; - H[0] = 0xcbbb9d5dc1059ed8ULL; - H[1] = 0x629a292a367cd507ULL; - H[2] = 0x9159015a3070dd17ULL; - H[3] = 0x152fecd8f70e5939ULL; - H[4] = 0x67332667ffc00b31ULL; - H[5] = 0x8eb44a8768581511ULL; - H[6] = 0xdb0c2e0d64f98fa7ULL; - H[7] = 0x47b5481dbefa4fa4ULL; + H[0] = 0xcbbb9d5dc1059ed8LL; + H[1] = 0x629a292a367cd507LL; + H[2] = 0x9159015a3070dd17LL; + H[3] = 0x152fecd8f70e5939LL; + H[4] = 0x67332667ffc00b31LL; + H[5] = 0x8eb44a8768581511LL; + H[6] = 0xdb0c2e0d64f98fa7LL; + H[7] = 0x47b5481dbefa4fa4LL; blkLen = 0; for (i = 0; i + 128 <= msgLen; i += 128) { diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h index d0f38409109..2b10abd050b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "GString.h" #include "Object.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc index 71ea377f8a7..c8c29736fe9 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h index 804fcdf1312..b05f729e0a8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #if MULTITHREADED #include "GMutex.h" #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc index f1e8dcffeac..e0d306857ca 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include "gmempp.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h index a078c757d33..12c8170f0b3 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc index 111f277d3c2..aec27dc5099 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h index 574330f6446..39e7613e4e6 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include #include "config.h" #include "gfile.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc index 966a3155c50..82f32b9dd93 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h index 73c92abe30c..bf1f25e51cc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc index ea7951a75fc..1539b8404bc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -532,7 +536,6 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict, out = outA; state = new GfxState(hDPI, vDPI, box, rotate, out->upsideDown()); fontChanged = gFalse; - haveSavedClipPath = gFalse; clip = clipNone; ignoreUndef = 0; out->startPage(pageNum, state); @@ -581,7 +584,6 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict, out = outA; state = new GfxState(72, 72, box, 0, gFalse); fontChanged = gFalse; - haveSavedClipPath = gFalse; clip = clipNone; ignoreUndef = 0; for (i = 0; i < 6; ++i) { @@ -1827,20 +1829,15 @@ void Gfx::opFillStroke(Object args[], int numArgs) { } if (state->isPath()) { if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gFalse); - } else { - out->fill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gFalse); + } else { + out->fill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); } else { - out->fillStroke(state, gFalse); + out->stroke(state); } } } @@ -1855,20 +1852,15 @@ void Gfx::opCloseFillStroke(Object args[], int numArgs) { if (state->isPath()) { state->closePath(); if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gFalse); - } else { - out->fill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gFalse); } else { - out->fillStroke(state, gFalse); + out->fill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); + } else { + out->stroke(state); } } } @@ -1882,20 +1874,15 @@ void Gfx::opEOFillStroke(Object args[], int numArgs) { } if (state->isPath()) { if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gTrue); - } else { - out->eoFill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gTrue); + } else { + out->eoFill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); } else { - out->fillStroke(state, gTrue); + out->stroke(state); } } } @@ -1910,20 +1897,15 @@ void Gfx::opCloseEOFillStroke(Object args[], int numArgs) { if (state->isPath()) { state->closePath(); if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gTrue); - } else { - out->eoFill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gTrue); } else { - out->fillStroke(state, gTrue); + out->eoFill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); + } else { + out->stroke(state); } } } @@ -1984,7 +1966,7 @@ void Gfx::doPatternStroke() { } } -void Gfx::doPatternText(GBool stroke) { +void Gfx::doPatternText() { GfxPattern *pattern; // this is a bit of a kludge -- patterns can be really slow, so we @@ -1994,8 +1976,7 @@ void Gfx::doPatternText(GBool stroke) { return; } - pattern = stroke ? state->getStrokePattern() : state->getFillPattern(); - if (!pattern) { + if (!(pattern = state->getFillPattern())) { return; } switch (pattern->getType()) { @@ -2212,30 +2193,16 @@ void Gfx::doTilingPatternFill(GfxTilingPattern *tPat, if (bbox[1] > bbox[3]) { t = bbox[1]; bbox[1] = bbox[3]; bbox[3] = t; } - xstep = tPat->getXStep(); - ystep = tPat->getYStep(); - if (xstep == 0 || ystep == 0) { - error(errSyntaxError, getPos(), "Zero x or y step in tiling pattern fill"); - goto err; - } - if (xstep > 0) { - xi0 = (int)ceil((xMin - bbox[2]) / xstep); - xi1 = (int)floor((xMax - bbox[0]) / xstep) + 1; - } else { - xi0 = (int)ceil((xMax - bbox[0]) / xstep); - xi1 = (int)floor((xMin - bbox[2]) / xstep) + 1; - } - if (ystep > 0) { - yi0 = (int)ceil((yMin - bbox[3]) / ystep); - yi1 = (int)floor((yMax - bbox[1]) / ystep) + 1; - } else { - yi0 = (int)ceil((yMax - bbox[1]) / ystep); - yi1 = (int)floor((yMin - bbox[3]) / ystep) + 1; - } + xstep = fabs(tPat->getXStep()); + ystep = fabs(tPat->getYStep()); + xi0 = (int)ceil((xMin - bbox[2]) / xstep); + xi1 = (int)floor((xMax - bbox[0]) / xstep) + 1; + yi0 = (int)ceil((yMin - bbox[3]) / ystep); + yi1 = (int)floor((yMax - bbox[1]) / ystep) + 1; for (i = 0; i < 4; ++i) { m1[i] = m[i]; } - if (out->useTilingPatternFill() && !tPat->usesBlendMode(xref)) { + if (out->useTilingPatternFill()) { m1[4] = m[4]; m1[5] = m[5]; out->tilingPatternFill(state, this, tPat->getContentStreamRef(), @@ -3554,16 +3521,12 @@ void Gfx::fillPatch(GfxPatch *patch, GfxPatchMeshShading *shading, int depth) { } void Gfx::doEndPath() { - if (clip != clipNone) { - if (state->isCurPt()) { - state->clip(); - if (clip == clipNormal) { - out->clip(state); - } else { - out->eoClip(state); - } + if (state->isCurPt() && clip != clipNone) { + state->clip(); + if (clip == clipNormal) { + out->clip(state); } else { - error(errSyntaxError, getPos(), "Empty path in clip"); + out->eoClip(state); } } clip = clipNone; @@ -3592,15 +3555,9 @@ void Gfx::opBeginText(Object args[], int numArgs) { out->updateTextMat(state); out->updateTextPos(state); fontChanged = gTrue; - haveSavedClipPath = gFalse; } void Gfx::opEndText(Object args[], int numArgs) { - if (haveSavedClipPath) { - out->clipToSavedClipPath(state); - haveSavedClipPath = gFalse; - } - out->endTextObject(state); } @@ -3829,8 +3786,27 @@ void Gfx::opShowSpaceText(Object args[], int numArgs) { } void Gfx::doShowText(GString *s) { - GfxFont *font = state->getFont(); - int wMode = font->getWMode(); + GfxFont *font; + int wMode; + double riseX, riseY; + CharCode code; + Unicode u[8]; + double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, ddx, ddy; + double originX, originY, tOriginX, tOriginY; + double x0, y0, x1, y1; + double oldCTM[6], newCTM[6]; + double *mat; + Object charProcRef, charProc; + Dict *resDict; + Parser *oldParser; + GfxState *savedState; + char *p; + int render; + GBool patternFill; + int len, n, uLen, nChars, nSpaces, i; + + font = state->getFont(); + wMode = font->getWMode(); if (globalParams->isDroppedFont(font->getName() ? font->getName()->getCString() : "")) { @@ -3842,63 +3818,35 @@ void Gfx::doShowText(GString *s) { out->beginString(state, s); } - // figure out the drawing mode - // note: clipping, pattern fill, and pattern stroke are all handled - // by saving the path and then performing the appropriate - // actions in opEndText() - GBool doFill = gFalse; - GBool doStroke = gFalse; - GBool doMakePath = gFalse; - int render = state->getRender() & 7; - switch (render & 7) { - case 0: // fill - if (state->getFillColorSpace()->getMode() == csPattern) { - doMakePath = gTrue; - } else { - doFill = gTrue; - } - break; - case 1: // stroke - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doMakePath = gTrue; + // if we're doing a pattern fill, set up clipping + render = state->getRender(); + if (!(render & 1) && + state->getFillColorSpace()->getMode() == csPattern) { + patternFill = gTrue; + saveState(); + // disable fill, enable clipping, leave stroke unchanged + if ((render ^ (render >> 1)) & 1) { + render = 5; } else { - doStroke = gTrue; + render = 7; } - break; - case 2: // fill + stroke - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - doMakePath = gTrue; - } else { - doFill = gTrue; - doStroke = gTrue; - } - break; - case 3: // invisible - // nothing - break; - case 4: // fill + clip - case 5: // stroke + clip - case 6: // fill + stroke + clip - case 7: // clip - doMakePath = gTrue; - break; + state->setRender(render); + out->updateRender(state); + } else { + patternFill = gFalse; } - double riseX, riseY; state->textTransformDelta(0, state->getRise(), &riseX, &riseY); - double xMin = state->getCurX() + riseX; - double yMin = state->getCurY() + riseY; + x0 = state->getCurX() + riseX; + y0 = state->getCurY() + riseY; // handle a Type 3 char if (font->getType() == fontType3 && out->interpretType3Chars()) { - double *mat = state->getCTM(); - double oldCTM[6]; - for (int i = 0; i < 6; ++i) { + mat = state->getCTM(); + for (i = 0; i < 6; ++i) { oldCTM[i] = mat[i]; } mat = state->getTextMat(); - double newCTM[6]; newCTM[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2]; newCTM[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3]; newCTM[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2]; @@ -3914,29 +3862,24 @@ void Gfx::doShowText(GString *s) { newCTM[3] *= state->getFontSize(); newCTM[0] *= state->getHorizScaling(); newCTM[1] *= state->getHorizScaling(); - double curX = state->getCurX(); - double curY = state->getCurY(); - Parser *oldParser = parser; - char *p = s->getCString(); - int len = s->getLength(); + curX = state->getCurX(); + curY = state->getCurY(); + oldParser = parser; + p = s->getCString(); + len = s->getLength(); while (len > 0) { - CharCode code; - Unicode u[8]; - int uLen; - double dx, dy, originX, originY; - int n = font->getNextChar(p, len, &code, - u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, - &dx, &dy, &originX, &originY); + n = font->getNextChar(p, len, &code, + u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, + &dx, &dy, &originX, &originY); dx = dx * state->getFontSize() + state->getCharSpace(); if (n == 1 && *p == ' ') { dx += state->getWordSpace(); } dx *= state->getHorizScaling(); dy *= state->getFontSize(); - double tdx, tdy, ddx, ddy, x, y; state->textTransformDelta(dx, dy, &tdx, &tdy); state->transform(curX + riseX, curY + riseY, &x, &y); - GfxState *savedState = saveStateStack(); + savedState = saveStateStack(); state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y); //~ the CTM concat values here are wrong (but never used) out->updateCTM(state, 1, 0, 0, 1, 0, 0); @@ -3956,11 +3899,9 @@ void Gfx::doShowText(GString *s) { #endif if (!out->beginType3Char(state, curX + riseX, curY + riseY, ddx, ddy, code, u, uLen)) { - Object charProcRef, charProc; ((Gfx8BitFont *)font)->getCharProcNF(code, &charProcRef); charProcRef.fetch(xref, &charProc); - Dict *resDict = ((Gfx8BitFont *)font)->getResources(); - if (resDict) { + if ((resDict = ((Gfx8BitFont *)font)->getResources())) { pushResources(resDict); } if (charProc.isStream()) { @@ -3986,16 +3927,12 @@ void Gfx::doShowText(GString *s) { parser = oldParser; } else if (out->useDrawChar()) { - char *p = s->getCString(); - int len = s->getLength(); + p = s->getCString(); + len = s->getLength(); while (len > 0) { - CharCode code; - Unicode u[8]; - int uLen; - double dx, dy, originX, originY; - int n = font->getNextChar(p, len, &code, - u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, - &dx, &dy, &originX, &originY); + n = font->getNextChar(p, len, &code, + u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, + &dx, &dy, &originX, &originY); if (wMode) { dx *= state->getFontSize(); dy = dy * state->getFontSize() + state->getCharSpace(); @@ -4010,32 +3947,26 @@ void Gfx::doShowText(GString *s) { dx *= state->getHorizScaling(); dy *= state->getFontSize(); } - double tdx, tdy, tOriginX, tOriginY; state->textTransformDelta(dx, dy, &tdx, &tdy); originX *= state->getFontSize(); originY *= state->getFontSize(); state->textTransformDelta(originX, originY, &tOriginX, &tOriginY); out->drawChar(state, state->getCurX() + riseX, state->getCurY() + riseY, - tdx, tdy, tOriginX, tOriginY, code, n, u, uLen, - doFill, doStroke, doMakePath); + tdx, tdy, tOriginX, tOriginY, code, n, u, uLen); state->shift(tdx, tdy); p += n; len -= n; } } else { - double dx = 0, dy = 0; - char *p = s->getCString(); - int len = s->getLength(); - int nChars = 0, nSpaces = 0; + dx = dy = 0; + p = s->getCString(); + len = s->getLength(); + nChars = nSpaces = 0; while (len > 0) { - CharCode code; - Unicode u[8]; - int uLen; - double dx2, dy2, originX, originY; - int n = font->getNextChar(p, len, &code, - u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, - &dx2, &dy2, &originX, &originY); + n = font->getNextChar(p, len, &code, + u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, + &dx2, &dy2, &originX, &originY); dx += dx2; dy += dy2; if (n == 1 && *p == ' ') { @@ -4057,9 +3988,8 @@ void Gfx::doShowText(GString *s) { dx *= state->getHorizScaling(); dy *= state->getFontSize(); } - double tdx, tdy; state->textTransformDelta(dx, dy, &tdx, &tdy); - out->drawString(state, s, doFill, doStroke, doMakePath); + out->drawString(state, s); state->shift(tdx, tdy); } @@ -4067,70 +3997,40 @@ void Gfx::doShowText(GString *s) { out->endString(state); } - if (doMakePath) { - // compute the clipping bbox for the saved text path -- assume + if (patternFill) { + out->saveTextPos(state); + // tell the OutputDev to do the clipping + out->endTextObject(state); + // set up a clipping bbox so doPatternText will work -- assume // that the text bounding box does not extend past the baseline in // any direction by more than twice the font size - double xMax = state->getCurX() + riseX; - double yMax = state->getCurY() + riseY; - double t; - if (xMin > xMax) { - t = xMin; xMin = xMax; xMax = t; + x1 = state->getCurX() + riseX; + y1 = state->getCurY() + riseY; + if (x0 > x1) { + x = x0; x0 = x1; x1 = x; } - if (yMin > yMax) { - t = yMin; yMin = yMax; yMax = t; + if (y0 > y1) { + y = y0; y0 = y1; y1 = y; } - double dx1, dy1, dx2, dy2; - state->textTransformDelta(0, state->getFontSize(), &dx1, &dy1); + state->textTransformDelta(0, state->getFontSize(), &dx, &dy); state->textTransformDelta(state->getFontSize(), 0, &dx2, &dy2); - dx1 = fabs(dx1); + dx = fabs(dx); dx2 = fabs(dx2); - if (dx2 > dx1) { - dx1 = dx2; + if (dx2 > dx) { + dx = dx2; } - dy1 = fabs(dy1); + dy = fabs(dy); dy2 = fabs(dy2); - if (dy2 > dy1) { - dy1 = dy2; - } - xMin -= 2 * dx1; - yMin -= 2 * dy1; - xMax += 2 * dx1; - yMax += 2 * dy1; - - //--- fill - if ((render & 3) == 0 || (render & 3) == 2) { - if (state->getFillColorSpace()->getMode() == csPattern) { - saveState(); - state->clipToRect(xMin, yMin, xMax, yMax); - out->clipToTextPath(state); - doPatternText(gFalse); - restoreState(); - } else { - out->fillTextPath(state); - } - } - - //--- stroke - if ((render & 3) == 1 || (render & 3) == 2) { - if (state->getStrokeColorSpace()->getMode() == csPattern) { - saveState(); - state->clipToRect(xMin, yMin, xMax, yMax); - out->clipToTextStrokePath(state); - doPatternText(gTrue); - restoreState(); - } else { - out->strokeTextPath(state); - } - } - - //--- clip - if (render & 4) { - out->addTextPathToSavedClipPath(state); - haveSavedClipPath = gTrue; - } else { - out->clearTextPath(state); - } + if (dy2 > dy) { + dy = dy2; + } + state->clipToRect(x0 - 2 * dx, y0 - 2 * dy, x1 + 2 * dx, y1 + 2 * dy); + // set render mode to fill-only + state->setRender(0); + out->updateRender(state); + doPatternText(); + restoreState(); + out->restoreTextPos(state); } opCounter += 10 * s->getLength(); @@ -4216,7 +4116,6 @@ void Gfx::opXObject(Object args[], int numArgs) { xObj.streamGetDict()->lookup("Level1", &obj3); out->psXObject(xObj.getStream(), obj3.isStream() ? obj3.getStream() : (Stream *)NULL); - obj3.free(); } } else if (obj2.isName()) { error(errSyntaxError, getPos(), @@ -4292,14 +4191,10 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); dict->lookup("W", &obj1); } - if (obj1.isInt()) { - width = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image width"); - width = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { goto err2; } + width = obj1.getInt(); obj1.free(); if (width <= 0) { goto err1; @@ -4309,14 +4204,10 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); dict->lookup("H", &obj1); } - if (obj1.isInt()) { - height = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image height"); - height = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { goto err2; } + height = obj1.getInt(); obj1.free(); if (height <= 0) { goto err1; @@ -4342,14 +4233,8 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); dict->lookup("BPC", &obj1); } - if (obj1.isNum()) { - if (obj1.isInt()) { - bits = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), - "Non-integer image bits per component"); - bits = (int)obj1.getReal(); - } + if (obj1.isInt()) { + bits = obj1.getInt(); if (bits < 1 || bits > 16) { goto err2; } @@ -4492,34 +4377,26 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); maskDict->lookup("W", &obj1); } - if (obj1.isInt()) { - maskWidth = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask width"); - maskWidth = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { delete colorMap; maskObj.free(); smaskObj.free(); goto err2; } + maskWidth = obj1.getInt(); obj1.free(); maskDict->lookup("Height", &obj1); if (obj1.isNull()) { obj1.free(); maskDict->lookup("H", &obj1); } - if (obj1.isInt()) { - maskHeight = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask height"); - maskHeight = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { delete colorMap; maskObj.free(); smaskObj.free(); goto err2; } + maskHeight = obj1.getInt(); obj1.free(); if (maskWidth <= 0 || maskHeight <= 0) { delete colorMap; @@ -4532,18 +4409,13 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); maskDict->lookup("BPC", &obj1); } - if (obj1.isInt()) { - maskBits = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), - "Non-integer image mask bits per component"); - maskBits = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { delete colorMap; maskObj.free(); smaskObj.free(); goto err2; } + maskBits = obj1.getInt(); obj1.free(); if (maskBits < 1 || maskBits > 16) { delete colorMap; @@ -4640,7 +4512,6 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { } } else if (maskObj.isStream()) { // explicit mask - haveExplicitMask = gTrue; if (inlineImg) { delete colorMap; maskObj.free(); @@ -4655,31 +4526,32 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); maskDict->lookup("W", &obj1); } - if (obj1.isInt()) { - maskWidth = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask width"); - maskWidth = (int)obj1.getReal(); - } else { - haveExplicitMask = gFalse; + if (!obj1.isInt()) { + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } + maskWidth = obj1.getInt(); obj1.free(); maskDict->lookup("Height", &obj1); if (obj1.isNull()) { obj1.free(); maskDict->lookup("H", &obj1); } - if (obj1.isInt()) { - maskHeight = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask height"); - maskHeight = (int)obj1.getReal(); - } else { - haveExplicitMask = gFalse; + if (!obj1.isInt()) { + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } + maskHeight = obj1.getInt(); obj1.free(); if (maskWidth <= 0 || maskHeight <= 0) { - haveExplicitMask = gFalse; + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } maskDict->lookup("ImageMask", &obj1); if (obj1.isNull()) { @@ -4687,7 +4559,10 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { maskDict->lookup("IM", &obj1); } if (!obj1.isBool() || !obj1.getBool()) { - haveExplicitMask = gFalse; + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } obj1.free(); maskInvert = gFalse; @@ -4701,12 +4576,13 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { maskInvert = obj2.isNum() && obj2.getNum() == 1; obj2.free(); } else if (!obj1.isNull()) { - haveExplicitMask = gFalse; + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } obj1.free(); - if (!haveExplicitMask) { - error(errSyntaxError, getPos(), "Bad image parameters"); - } + haveExplicitMask = gTrue; } // if drawing is disabled, skip over inline image data @@ -4892,8 +4768,6 @@ void Gfx::drawForm(Object *strRef, Dict *resDict, double oldBaseMatrix[6]; int i; - out->startStream(strRef->getRef(), state); - // push new resources on stack pushResources(resDict); @@ -5023,7 +4897,7 @@ void Gfx::drawForm(Object *strRef, Dict *resDict, delete blendingColorSpace; } - out->endStream(strRef->getRef()); + return; } void Gfx::takeContentStreamStack(Gfx *oldGfx) { @@ -5062,9 +4936,7 @@ void Gfx::opBeginImage(Object args[], int numArgs) { // if we have the stream length, skip to end-of-stream and then // skip 'EI' in the original stream } else if (haveLength) { - // NB: getUndecodedStream() returns the EmbedStream created by - // buildImageStream() - while ((c1 = str->getUndecodedStream()->getChar()) != EOF) ; + while ((c1 = str->getChar()) != EOF) ; delete str; str = parser->getStream(); c1 = str->getChar(); @@ -5219,28 +5091,15 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs) { } obj.free(); mcKind = gfxMCOptionalContent; - } else if (numArgs == 2 && args[1].isDict()) { - if (args[0].isName("Span")) { - if (args[1].dictLookup("ActualText", &obj)->isString()) { - s = new TextString(obj.getString()); - out->beginActualText(state, s->getUnicode(), s->getLength()); - delete s; - mcKind = gfxMCActualText; - } - obj.free(); - } - if (args[1].dictLookup("MCID", &obj)->isInt()) { - out->beginStructureItem(args[0].getName(), obj.getInt(), - args[1].getDict()); - if (mcKind == gfxMCActualText) { - mcKind = gfxMCStructureItemAndActualText; - } else { - mcKind = gfxMCStructureItem; - } + } else if (args[0].isName("Span") && numArgs == 2 && args[1].isDict()) { + if (args[1].dictLookup("ActualText", &obj)->isString()) { + s = new TextString(obj.getString()); + out->beginActualText(state, s->getUnicode(), s->getLength()); + delete s; + mcKind = gfxMCActualText; } obj.free(); } - mc = new GfxMarkedContent(mcKind, ocState); markedContentStack->append(mc); } @@ -5264,11 +5123,6 @@ void Gfx::opEndMarkedContent(Object args[], int numArgs) { } } else if (mcKind == gfxMCActualText) { out->endActualText(state); - } else if (mcKind == gfxMCStructureItem) { - out->endStructureItem(); - } else if (mcKind == gfxMCStructureItemAndActualText) { - out->endStructureItem(); - out->endActualText(state); } } else { error(errSyntaxWarning, getPos(), "Mismatched EMC operator"); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h index 0f288cf3b9d..14d7a608438 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "gfile.h" #include "GfxState.h" @@ -102,8 +106,6 @@ private: enum GfxMarkedContentKind { gfxMCOptionalContent, gfxMCActualText, - gfxMCStructureItem, - gfxMCStructureItemAndActualText, gfxMCOther }; @@ -192,7 +194,6 @@ private: GfxState *state; // current graphics state GBool fontChanged; // set if font or text matrix has changed - GBool haveSavedClipPath; GfxClipType clip; // do a clip? int ignoreUndef; // current BX/EX nesting level double baseMatrix[6]; // default matrix for most recent @@ -272,7 +273,7 @@ private: void opCloseEOFillStroke(Object args[], int numArgs); void doPatternFill(GBool eoFill); void doPatternStroke(); - void doPatternText(GBool stroke); + void doPatternText(); void doPatternImageMask(Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg, GBool interpolate); void doTilingPatternFill(GfxTilingPattern *tPat, diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc index c3db4e8651b..30e8bd1c79c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -303,10 +307,26 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) { obj2.initNull(); } - // NB: the PDF spec doesn't say anything about precedence, but Adobe - // uses FontFile3 over FontFile2 if both are present. if (fontDict2->lookup("FontDescriptor", &fontDesc)->isDict()) { - if (fontDesc.dictLookupNF("FontFile3", &obj3)->isRef()) { + if (fontDesc.dictLookupNF("FontFile", &obj3)->isRef()) { + *embID = obj3.getRef(); + if (expectedType != fontType1) { + err = gTrue; + } + } + obj3.free(); + if (embID->num == -1 && + fontDesc.dictLookupNF("FontFile2", &obj3)->isRef()) { + *embID = obj3.getRef(); + if (isType0) { + expectedType = fontCIDType2; + } else if (expectedType != fontTrueType) { + err = gTrue; + } + } + obj3.free(); + if (embID->num == -1 && + fontDesc.dictLookupNF("FontFile3", &obj3)->isRef()) { *embID = obj3.getRef(); if (obj3.fetch(xref, &obj4)->isStream()) { obj4.streamGetDict()->lookup("Subtype", &subtype); @@ -355,26 +375,6 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) { obj4.free(); } obj3.free(); - if (embID->num == -1) { - if (fontDesc.dictLookupNF("FontFile2", &obj3)->isRef()) { - *embID = obj3.getRef(); - if (isType0) { - expectedType = fontCIDType2; - } else if (expectedType != fontTrueType) { - err = gTrue; - } - } - obj3.free(); - } - if (embID->num == -1) { - if (fontDesc.dictLookupNF("FontFile", &obj3)->isRef()) { - *embID = obj3.getRef(); - if (expectedType != fontType1) { - err = gTrue; - } - } - obj3.free(); - } } fontDesc.free(); @@ -533,33 +533,6 @@ void GfxFont::readFontDescriptor(XRef *xref, Dict *fontDict) { } obj1.free(); - - // scan font name for bold/italic tags and update the flags - if (name) { - i = name->getLength(); - if (i > 2 && !strncmp(name->getCString() + i - 2, "MT", 2)) { - i -= 2; - } - if (i > 6 && !strncmp(name->getCString() + i - 6, "Italic", 6)) { - flags |= fontItalic; - i -= 6; - } else if (i > 2 && !strncmp(name->getCString() + i - 2, "It", 2)) { - flags |= fontItalic; - i -= 2; - } else if (i > 7 && !strncmp(name->getCString() + i - 7, "Oblique", 7)) { - flags |= fontItalic; - i -= 7; - } - char c = name->getChar(i-1); - if (!((c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - (c >= '0' && c <= '9'))) { - --i; - } - if (i > 4 && !strncmp(name->getCString() + i - 4, "Bold", 4)) { - flags |= fontBold; - } - } } CharCodeToUnicode *GfxFont::readToUnicodeCMap(Dict *fontDict, int nBits, @@ -1463,7 +1436,7 @@ CharCodeToUnicode *Gfx8BitFont::getToUnicode() { int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { int *map; int cmapPlatform, cmapEncoding; - int unicodeCmap, macRomanCmap, macUnicodeCmap, msSymbolCmap, cmap; + int unicodeCmap, macRomanCmap, msSymbolCmap, cmap; GBool nonsymbolic, useMacRoman, useUnicode; char *charName; Unicode u; @@ -1477,16 +1450,15 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { // This is based on the cmap/encoding selection algorithm in the PDF // 2.0 spec, but with some differences to match up with Adobe's // behavior. - unicodeCmap = macRomanCmap = macUnicodeCmap = msSymbolCmap = -1; + unicodeCmap = macRomanCmap = msSymbolCmap = -1; for (i = 0; i < ff->getNumCmaps(); ++i) { cmapPlatform = ff->getCmapPlatform(i); cmapEncoding = ff->getCmapEncoding(i); - if (cmapPlatform == 3 && cmapEncoding == 1) { + if ((cmapPlatform == 3 && cmapEncoding == 1) || + (cmapPlatform == 0 && cmapEncoding <= 4)) { unicodeCmap = i; } else if (cmapPlatform == 1 && cmapEncoding == 0) { macRomanCmap = i; - } else if (cmapPlatform == 0 && cmapEncoding <= 4) { - macUnicodeCmap = i; } else if (cmapPlatform == 3 && cmapEncoding == 0) { msSymbolCmap = i; } @@ -1494,25 +1466,24 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { useMacRoman = gFalse; useUnicode = gFalse; nonsymbolic = !(flags & fontSymbolic); - if (embFontID.num < 0 && hasEncoding && unicodeCmap >= 0) { + if (usesMacRomanEnc && macRomanCmap >= 0) { + cmap = macRomanCmap; + useMacRoman = gTrue; + } else if (embFontID.num < 0 && hasEncoding && unicodeCmap >= 0) { cmap = unicodeCmap; useUnicode = gTrue; - } else if (!nonsymbolic && msSymbolCmap >= 0) { - cmap = msSymbolCmap; - } else if (unicodeCmap >= 0) { + } else if (nonsymbolic && unicodeCmap >= 0) { cmap = unicodeCmap; - useUnicode = nonsymbolic; - } else if (usesMacRomanEnc && macRomanCmap >= 0) { - // MacRoman cmap has higher precedence than Mac Unicode only if - // the font uses the MacRoman encoding + useUnicode = gTrue; + } else if (nonsymbolic && macRomanCmap >= 0) { cmap = macRomanCmap; useMacRoman = gTrue; - } else if (macUnicodeCmap >= 0) { - cmap = macUnicodeCmap; - useUnicode = nonsymbolic; + } else if (msSymbolCmap >= 0) { + cmap = msSymbolCmap; + } else if (unicodeCmap >= 0) { + cmap = unicodeCmap; } else if (macRomanCmap >= 0) { cmap = macRomanCmap; - useMacRoman = nonsymbolic; } else { cmap = 0; } @@ -2258,99 +2229,75 @@ GBool GfxCIDFont::problematicForUnicode() { // GfxFontDict //------------------------------------------------------------------------ -class GfxFontDictEntry { -public: - - GfxFontDictEntry(Ref refA, Object *fontObjA); - ~GfxFontDictEntry(); - void load(GfxFont *fontA); - - GBool loaded; - Ref ref; - Object fontObj; // valid if unloaded - GfxFont *font; // valid if loaded -}; - -GfxFontDictEntry::GfxFontDictEntry(Ref refA, Object *fontObjA) { - loaded = gFalse; - ref = refA; - fontObjA->copy(&fontObj); - font = NULL; -} - -GfxFontDictEntry::~GfxFontDictEntry() { - // NB: If the font has been loaded, font is non-NULL and is owned by - // GfxFontDict.uniqueFonts. - if (!loaded) { - fontObj.free(); - } -} - -void GfxFontDictEntry::load(GfxFont *fontA) { - loaded = gTrue; - font = fontA; - fontObj.free(); -} +GfxFontDict::GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict) { + GfxFont *font; + char *tag; + Object obj1, obj2; + Ref r; + int i; -GfxFontDict::GfxFontDict(XRef *xrefA, Ref *fontDictRef, Dict *fontDict) { - xref = xrefA; fonts = new GHash(gTrue); uniqueFonts = new GList(); - - for (int i = 0; i < fontDict->getLength(); ++i) { - char *tag = fontDict->getKey(i); - Object fontObj; - fontDict->getValNF(i, &fontObj); - Ref r; - if (fontObj.isRef()) { - r = fontObj.getRef(); - } else if (fontDictRef) { - // legal generation numbers are five digits, so we use a - // 6-digit number here - r.gen = 100000 + fontDictRef->num; - r.num = i; + for (i = 0; i < fontDict->getLength(); ++i) { + tag = fontDict->getKey(i); + fontDict->getValNF(i, &obj1); + obj1.fetch(xref, &obj2); + if (!obj2.isDict()) { + error(errSyntaxError, -1, "font resource is not a dictionary"); + } else if (obj1.isRef() && (font = lookupByRef(obj1.getRef()))) { + fonts->add(new GString(tag), font); } else { - // no indirect reference for this font, or for the containing - // font dict, so hash the font and use that - r.gen = 100000; - r.num = hashFontObject(&fontObj); + if (obj1.isRef()) { + r = obj1.getRef(); + } else if (fontDictRef) { + // legal generation numbers are five digits, so we use a + // 6-digit number here + r.gen = 100000 + fontDictRef->num; + r.num = i; + } else { + // no indirect reference for this font, or for the containing + // font dict, so hash the font and use that + r.gen = 100000; + r.num = hashFontObject(&obj2); + } + if ((font = GfxFont::makeFont(xref, tag, r, obj2.getDict()))) { + if (!font->isOk()) { + delete font; + } else { + uniqueFonts->append(font); + fonts->add(new GString(tag), font); + } + } } - fonts->add(new GString(tag), new GfxFontDictEntry(r, &fontObj)); - fontObj.free(); + obj1.free(); + obj2.free(); } } GfxFontDict::~GfxFontDict() { deleteGList(uniqueFonts, GfxFont); - deleteGHash(fonts, GfxFontDictEntry); + delete fonts; } GfxFont *GfxFontDict::lookup(char *tag) { - GfxFontDictEntry *entry = (GfxFontDictEntry *)fonts->lookup(tag); - if (!entry) { - return NULL; - } - load(tag, entry); - return entry->font; + return (GfxFont *)fonts->lookup(tag); } GfxFont *GfxFontDict::lookupByRef(Ref ref) { - GHashIter *iter; - GString *tag; - GfxFontDictEntry *entry; - fonts->startIter(&iter); - while (fonts->getNext(&iter, &tag, (void **)&entry)) { - if (entry->ref.num == ref.num && entry->ref.gen == ref.gen) { - fonts->killIter(&iter); - load(tag->getCString(), entry); - return entry->font; + GfxFont *font; + int i; + + for (i = 0; i < uniqueFonts->getLength(); ++i) { + font = (GfxFont *)uniqueFonts->get(i); + if (font->getID()->num == ref.num && + font->getID()->gen == ref.gen) { + return font; } } return NULL; } int GfxFontDict::getNumFonts() { - loadAll(); return uniqueFonts->getLength(); } @@ -2358,52 +2305,6 @@ GfxFont *GfxFontDict::getFont(int i) { return (GfxFont *)uniqueFonts->get(i); } -void GfxFontDict::loadAll() { - GHashIter *iter; - GString *tag; - GfxFontDictEntry *entry; - fonts->startIter(&iter); - while (fonts->getNext(&iter, &tag, (void **)&entry)) { - load(tag->getCString(), entry); - } -} - -void GfxFontDict::load(char *tag, GfxFontDictEntry *entry) { - if (entry->loaded) { - return; - } - - // check for a duplicate that has already been loaded - // (don't do this for "synthetic" refs) - if (entry->fontObj.isRef()) { - for (int i = 0; i < uniqueFonts->getLength(); ++i) { - GfxFont *font = (GfxFont *)uniqueFonts->get(i); - if (font->getID()->num == entry->ref.num && - font->getID()->gen == entry->ref.gen) { - entry->load(font); - return; - } - } - } - - GfxFont *font = NULL; - Object obj; - entry->fontObj.fetch(xref, &obj); - if (obj.isDict()) { - font = GfxFont::makeFont(xref, tag, entry->ref, obj.getDict()); - if (font->isOk()) { - uniqueFonts->append(font); - } else { - delete font; - font = NULL; - } - } else { - error(errSyntaxError, -1, "font resource is not a dictionary"); - } - obj.free(); - entry->load(font); -} - // FNV-1a hash class FNVHash { public: diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h index ec6d3c3d246..e752ded62f8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "GString.h" #include "Object.h" @@ -25,7 +29,6 @@ class FoFiTrueType; class FoFiType1C; struct GfxFontCIDWidths; struct Base14FontMapEntry; -class GfxFontDictEntry; class FNVHash; //------------------------------------------------------------------------ @@ -385,7 +388,7 @@ class GfxFontDict { public: // Build the font dictionary, given the PDF font dictionary. - GfxFontDict(XRef *xrefA, Ref *fontDictRef, Dict *fontDict); + GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict); // Destructor. ~GfxFontDict(); @@ -402,18 +405,13 @@ private: friend class GfxFont; - void loadAll(); - void load(char *tag, GfxFontDictEntry *entry); static int hashFontObject(Object *obj); static void hashFontObject1(Object *obj, FNVHash *h); - XRef *xref; - GHash *fonts; // hash table of fonts, mapping from - // tag to GfxFontDictEntry; this may - // contain duplicates, i.e., two - // tags that map to the same font + GHash *fonts; // hash table of fonts -- this may + // include duplicates, i.e., when + // two tags map to the same font GList *uniqueFonts; // list of all unique font objects (no dups) - // that have been loaded }; #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc index 9aed7345ad2..43503aaedb8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -932,15 +936,15 @@ GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr, } nCompsA = obj2.getInt(); obj2.free(); - if (!dict->lookup("Alternate", &obj2)->isNull() && - (altA = GfxColorSpace::parse(&obj2, - recursion + 1))) { - if (altA->getNComps() != nCompsA) { - error(errSyntaxError, -1, - "Number of components in ICCBased color space doesn't match alternate color space"); - nCompsA = altA->getNComps(); - } - } else { + if (nCompsA > 4) { + error(errSyntaxError, -1, + "ICCBased color space with too many ({0:d} > 4) components", + nCompsA); + nCompsA = 4; + } + if (dict->lookup("Alternate", &obj2)->isNull() || + !(altA = GfxColorSpace::parse(&obj2, + recursion + 1))) { switch (nCompsA) { case 1: altA = GfxColorSpace::create(csDeviceGray); @@ -1780,258 +1784,6 @@ GfxPattern *GfxTilingPattern::copy() { &resDict, matrix, &contentStreamRef); } -GBool GfxTilingPattern::usesBlendMode(XRef *xref) { - char *scannedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(scannedObjs, 0, xref->getNumObjects()); - GBool ret = scanResourcesForBlendMode(&resDict, scannedObjs, xref); - gfree(scannedObjs); - return ret; -} - -GBool GfxTilingPattern::scanResourcesForBlendMode(Object *resDict2, - char *scannedObjs, - XRef *xref) { - Object ref1, obj1, obj2; - - if (!resDict2->isDict()) { - return gFalse; - } - - //----- ExtGStates - resDict2->dictLookupNF("ExtGState", &ref1); - if (!ref1.isRef() || (ref1.getRefNum() < xref->getNumObjects() && - !scannedObjs[ref1.getRefNum()])) { - if (ref1.isRef()) { - scannedObjs[ref1.getRefNum()] = 1; - ref1.fetch(xref, &obj1); - } else { - ref1.copy(&obj1); - } - if (obj1.isDict()) { - for (int i = 0; i < obj1.dictGetLength(); ++i) { - if (scanExtGStateForBlendMode(obj1.dictGetValNF(i, &obj2), - scannedObjs, xref)) { - obj2.free(); - obj1.free(); - ref1.free(); - return gTrue; - } - obj2.free(); - } - } - obj1.free(); - } - ref1.free(); - - //----- patterns - resDict2->dictLookupNF("Pattern", &ref1); - if (!ref1.isRef() || (ref1.getRefNum() < xref->getNumObjects() && - !scannedObjs[ref1.getRefNum()])) { - if (ref1.isRef()) { - scannedObjs[ref1.getRefNum()] = 1; - ref1.fetch(xref, &obj1); - } else { - ref1.copy(&obj1); - } - if (obj1.isDict()) { - for (int i = 0; i < obj1.dictGetLength(); ++i) { - if (scanPatternForBlendMode(obj1.dictGetValNF(i, &obj2), - scannedObjs, xref)) { - obj2.free(); - obj1.free(); - ref1.free(); - return gTrue; - } - obj2.free(); - } - } - obj1.free(); - } - ref1.free(); - - //----- XObjects - resDict2->dictLookupNF("XObject", &ref1); - if (!ref1.isRef() || (ref1.getRefNum() < xref->getNumObjects() && - !scannedObjs[ref1.getRefNum()])) { - if (ref1.isRef()) { - scannedObjs[ref1.getRefNum()] = 1; - ref1.fetch(xref, &obj1); - } else { - ref1.copy(&obj1); - } - if (obj1.isDict()) { - for (int i = 0; i < obj1.dictGetLength(); ++i) { - if (scanXObjectForBlendMode(obj1.dictGetValNF(i, &obj2), - scannedObjs, xref)) { - obj2.free(); - obj1.free(); - ref1.free(); - return gTrue; - } - obj2.free(); - } - } - obj1.free(); - } - ref1.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanExtGStateForBlendMode(Object *gsObj, - char *scannedObjs, - XRef *xref) { - Object gsDict, obj1; - - if (gsObj->isRef()) { - if (gsObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[gsObj->getRefNum()]) { - return gFalse; - } - scannedObjs[gsObj->getRefNum()] = 1; - gsObj->fetch(xref, &gsDict); - } else { - gsObj->copy(&gsDict); - } - if (!gsDict.isDict()) { - gsDict.free(); - return gFalse; - } - - gsDict.dictLookup("BM", &obj1); - if (obj1.isName() && !obj1.isName("Normal")) { - obj1.free(); - gsDict.free(); - return gTrue; - } - obj1.free(); - - if (!gsDict.dictLookupNF("SMask", &obj1)->isNull()) { - if (scanSoftMaskForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - gsDict.free(); - return gTrue; - } - } - obj1.free(); - - gsDict.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanSoftMaskForBlendMode(Object *softMaskObj, - char *scannedObjs, - XRef *xref) { - Object softMaskDict, obj1; - - if (softMaskObj->isRef()) { - if (softMaskObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[softMaskObj->getRefNum()]) { - return gFalse; - } - scannedObjs[softMaskObj->getRefNum()] = 1; - softMaskObj->fetch(xref, &softMaskDict); - } else { - softMaskObj->copy(&softMaskDict); - } - if (!softMaskDict.isDict()) { - softMaskDict.free(); - return gFalse; - } - - if (!softMaskDict.dictLookupNF("G", &obj1)->isNull()) { - if (scanXObjectForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - softMaskDict.free(); - return gTrue; - } - } - obj1.free(); - - softMaskDict.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanPatternForBlendMode(Object *patternObj, - char *scannedObjs, - XRef *xref) { - Object patternObj2, obj1; - Dict *patternDict; - - if (patternObj->isRef()) { - if (patternObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[patternObj->getRefNum()]) { - return gFalse; - } - scannedObjs[patternObj->getRefNum()] = 1; - patternObj->fetch(xref, &patternObj2); - } else { - patternObj->copy(&patternObj2); - } - if (patternObj2.isDict()) { - patternDict = patternObj2.getDict(); - } else if (patternObj2.isStream()) { - patternDict = patternObj2.streamGetDict(); - } else { - patternObj2.free(); - return gFalse; - } - - if (!patternDict->lookupNF("Resources", &obj1)->isNull()) { - if (scanResourcesForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - patternObj2.free(); - return gTrue; - } - } - obj1.free(); - - patternObj2.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanXObjectForBlendMode(Object *xObj, - char *scannedObjs, - XRef *xref) { - Object xObj2, obj1; - Dict *dict; - - if (xObj->isRef()) { - if (xObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[xObj->getRefNum()]) { - return gFalse; - } - scannedObjs[xObj->getRefNum()] = 1; - xObj->fetch(xref, &xObj2); - } else { - xObj->copy(&xObj2); - } - if (xObj2.isDict()) { - dict = xObj2.getDict(); - } else if (xObj2.isStream()) { - dict = xObj2.streamGetDict(); - } else { - xObj2.free(); - return gFalse; - } - - if (!dict->lookupNF("Resources", &obj1)->isNull()) { - if (scanResourcesForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - xObj2.free(); - return gTrue; - } - } - obj1.free(); - - xObj2.free(); - - return gFalse; -} - //------------------------------------------------------------------------ // GfxShadingPattern //------------------------------------------------------------------------ @@ -3211,8 +2963,8 @@ void GfxGouraudTriangleShading::getTriangle( } } -void GfxGouraudTriangleShading::getBBox(double *xMinA, double *yMinA, - double *xMaxA, double *yMaxA) { +void GfxGouraudTriangleShading::getBBox(double *xMin, double *yMin, + double *xMax, double *yMax) { double xxMin = 0; double yyMin = 0; double xxMax = 0; @@ -3233,10 +2985,10 @@ void GfxGouraudTriangleShading::getBBox(double *xMinA, double *yMinA, yyMax = vertices[i].y; } } - *xMinA = xxMin; - *yMinA = yyMin; - *xMaxA = xxMax; - *yMaxA = yyMax; + *xMin = xxMin; + *yMin = yyMin; + *xMax = xxMax; + *yMax = yyMax; } void GfxGouraudTriangleShading::getColor(double *in, GfxColor *out) { @@ -3869,8 +3621,8 @@ GfxShading *GfxPatchMeshShading::copy() { return new GfxPatchMeshShading(this); } -void GfxPatchMeshShading::getBBox(double *xMinA, double *yMinA, - double *xMaxA, double *yMaxA) { +void GfxPatchMeshShading::getBBox(double *xMin, double *yMin, + double *xMax, double *yMax) { double xxMin = 0; double yyMin = 0; double xxMax = 0; @@ -3895,10 +3647,10 @@ void GfxPatchMeshShading::getBBox(double *xMinA, double *yMinA, } } } - *xMinA = xxMin; - *yMinA = yyMin; - *xMaxA = xxMax; - *yMaxA = yyMax; + *xMin = xxMin; + *yMin = yyMin; + *xMax = xxMax; + *yMax = yyMax; } void GfxPatchMeshShading::getColor(double *in, GfxColor *out) { @@ -4899,36 +4651,35 @@ void GfxState::clipToStrokePath() { // There are two cases for each point on the path: // (1) miter join, under miter limit => compute the miter point // (2) all other joins and caps => use the path point +/- 0.5 * line width - double uxMin = 0, uyMin = 0, uxMax = 0, uyMax = 0; + double xMin = 0, yMin = 0, xMax = 0, yMax = 0; double w = 0.5 * lineWidth; for (int i = 0; i < path->getNumSubpaths(); ++i) { GfxSubpath *subpath = path->getSubpath(i); - int nPoints; - if (subpath->isClosed()) { - nPoints = subpath->getNumPoints() - 1; - } else { - nPoints = subpath->getNumPoints(); - } - for (int j = 0; j < nPoints; ++j) { + for (int j = 0; j < subpath->getNumPoints(); ++j) { double x1 = subpath->getX(j); double y1 = subpath->getY(j); if (i == 0 && j == 0) { - uxMin = uxMax = x1; - uyMin = uyMax = y1; + xMin = xMax = x1; + yMin = yMax = y1; } GBool useMiter = gFalse; if (lineJoin == 0 && // miter join - (subpath->isClosed() || (j > 0 && j < subpath->getNumPoints() - 1))) { + ((j > 0 && j < subpath->getNumPoints() - 1) || subpath->isClosed())) { double x0, y0, x2, y2; - if (j == 0) { - x0 = subpath->getX(nPoints - 1); - y0 = subpath->getY(nPoints - 1); - } else { + if (j > 0) { x0 = subpath->getX(j - 1); y0 = subpath->getY(j - 1); + } else { + x0 = subpath->getLastX(); + y0 = subpath->getLastY(); + } + if (j < subpath->getNumPoints() - 1) { + x2 = subpath->getX(j + 1); + y2 = subpath->getY(j + 1); + } else { + x2 = subpath->getX(0); + y2 = subpath->getY(0); } - x2 = subpath->getX(j + 1); - y2 = subpath->getY(j + 1); if ((fabs(x1 - x0) > 0.0001 || fabs(y1 - y0) > 0.0001) && (fabs(x2 - x1) > 0.0001 || fabs(y2 - y1) > 0.0001)) { double d01 = 1 / sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); @@ -4953,15 +4704,15 @@ void GfxState::clipToStrokePath() { } double mx = ax + m * w * ux; double my = ay + m * w * uy; - if (mx < uxMin) { - uxMin = mx; - } else if (mx > uxMax) { - uxMax = mx; + if (mx < xMin) { + xMin = mx; + } else if (mx > xMax) { + xMax = mx; } - if (my < uyMin) { - uyMin = my; - } else if (my > uyMax) { - uyMax = my; + if (my < yMin) { + yMin = my; + } else if (my > yMax) { + yMax = my; } useMiter = gTrue; } @@ -4969,71 +4720,66 @@ void GfxState::clipToStrokePath() { } } if (!useMiter) { - if (x1 - w < uxMin) { - uxMin = x1 - w; + if (x1 - w < xMin) { + xMin = x1 - w; } - if (x1 + w > uxMax) { - uxMax = x1 + w; + if (x1 + w > xMax) { + xMax = x1 + w; } - if (y1 - w < uyMin) { - uyMin = y1 - w; + if (y1 - w < yMin) { + yMin = y1 - w; } - if (y1 + w > uyMax) { - uyMax = y1 + w; + if (y1 + w > yMax) { + yMax = y1 + w; } } } } - double dxMin, dyMin, dxMax, dyMax, xx, yy; - transform(uxMin, uyMin, &xx, &yy); - dxMin = dxMax = xx; - dyMin = dyMax = yy; - transform(uxMin, uyMax, &xx, &yy); - if (xx < dxMin) { - dxMin = xx; - } else if (xx > dxMax) { - dxMax = xx; - } - if (yy < dyMin) { - dyMin = yy; - } else if (yy > dyMax) { - dyMax = yy; - } - transform(uxMax, uyMin, &xx, &yy); - if (xx < dxMin) { - dxMin = xx; - } else if (xx > dxMax) { - dxMax = xx; - } - if (yy < dyMin) { - dyMin = yy; - } else if (yy > dyMax) { - dyMax = yy; - } - transform(uxMax, uyMax, &xx, &yy); - if (xx < dxMin) { - dxMin = xx; - } else if (xx > dxMax) { - dxMax = xx; - } - if (yy < dyMin) { - dyMin = yy; - } else if (yy > dyMax) { - dyMax = yy; - } - - if (dxMin > clipXMin) { - clipXMin = dxMin; - } - if (dyMin > clipYMin) { - clipYMin = dyMin; - } - if (dxMax < clipXMax) { - clipXMax = dxMax; - } - if (dyMax < clipYMax) { - clipYMax = dyMax; + double xx, yy; + transform(xMin, yMin, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; + } + transform(xMin, yMax, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; + } + transform(xMax, yMin, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; + } + transform(xMax, yMax, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; } } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h index 57b57e06a66..60d48527c29 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h @@ -11,6 +11,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" #include "Function.h" @@ -659,7 +663,6 @@ public: { return resDict.isDict() ? resDict.getDict() : (Dict *)NULL; } double *getMatrix() { return matrix; } Object *getContentStreamRef() { return &contentStreamRef; } - GBool usesBlendMode(XRef *xref); private: @@ -667,16 +670,6 @@ private: double *bboxA, double xStepA, double yStepA, Object *resDictA, double *matrixA, Object *contentStreamA); - GBool scanResourcesForBlendMode(Object *resDict2, - char *scannedObjs, XRef *xref); - GBool scanExtGStateForBlendMode(Object *gsObj, - char *scannedObjs, XRef *xref); - GBool scanSoftMaskForBlendMode(Object *softMaskObj, - char *scannedObjs, XRef *xref); - GBool scanPatternForBlendMode(Object *patternObj, - char *scannedObjs, XRef *xref); - GBool scanXObjectForBlendMode(Object *xObj, - char *scannedObjs, XRef *xref); int paintType; int tilingType; @@ -890,7 +883,7 @@ public: void getTriangle(int i, double *x0, double *y0, double *color0, double *x1, double *y1, double *color1, double *x2, double *y2, double *color2); - void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA); + void getBBox(double *xMin, double *yMin, double *xMax, double *yMax); void getColor(double *in, GfxColor *out); private: @@ -930,7 +923,7 @@ public: int getNComps() { return nComps; } int getNPatches() { return nPatches; } GfxPatch *getPatch(int i) { return &patches[i]; } - void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA); + void getBBox(double *xMin, double *yMin, double *xMax, double *yMax); void getColor(double *in, GfxColor *out); private: diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc index fcacd7f1e71..e7cc594b12d 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc @@ -8,6 +8,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include @@ -40,12 +44,10 @@ #include "GlobalParams.h" #ifdef _WIN32 -#ifndef __GNUC__ # undef strcasecmp # undef strncasecmp # define strcasecmp _stricmp # define strncasecmp _strnicmp -#endif #else # include #endif @@ -103,14 +105,14 @@ static struct { {NULL} }; -static const char *displayFontDirs[] = { -#ifdef BASE14_FONT_DIR - BASE14_FONT_DIR, -#endif #ifdef _WIN32 +static const char *displayFontDirs[] = { "c:/windows/fonts", "c:/winnt/fonts", -#else // _WIN32 + NULL +}; +#else +static const char *displayFontDirs[] = { "/usr/share/ghostscript/fonts", "/usr/local/share/ghostscript/fonts", "/usr/share/fonts/default/Type1", @@ -119,9 +121,9 @@ static const char *displayFontDirs[] = { #if defined(__sun) && defined(__SVR4) "/usr/sfw/share/ghostscript/fonts", #endif -#endif // _WIN32 NULL }; +#endif #ifdef __APPLE__ static const char *macSystemFontPath = "/System/Library/Fonts"; @@ -181,7 +183,7 @@ public: ~SysFontInfo(); GString *mungeName1(GString *in); GString *mungeName2(GString *in); - void mungeName3(GString *nameA, GBool *bold, GBool *italic); + void mungeName3(GString *name, GBool *bold, GBool *italic); int match(GString *nameA); }; @@ -258,24 +260,24 @@ GString *SysFontInfo::mungeName2(GString *in) { // Remove trailing bold/italic/regular/roman tags from the name. // (Note: the names have already been uppercased by mungeName1/2.) -void SysFontInfo::mungeName3(GString *nameA, GBool *bold, GBool *italic) { +void SysFontInfo::mungeName3(GString *name, GBool *bold, GBool *italic) { *bold = gFalse; *italic = gFalse; - int n = nameA->getLength(); + int n = name->getLength(); while (1) { - if (n >= 4 && !strcmp(nameA->getCString() + n - 4, "BOLD")) { - nameA->del(n - 4, 4); + if (n >= 4 && !strcmp(name->getCString() + n - 4, "BOLD")) { + name->del(n - 4, 4); n -= 4; *bold = gTrue; - } else if (n >= 6 && !strcmp(nameA->getCString() + n - 6, "ITALIC")) { - nameA->del(n - 6, 6); + } else if (n >= 6 && !strcmp(name->getCString() + n - 6, "ITALIC")) { + name->del(n - 6, 6); n -= 6; *italic = gTrue; - } else if (n >= 7 && !strcmp(nameA->getCString() + n - 7, "REGULAR")) { - nameA->del(n - 7, 7); + } else if (n >= 7 && !strcmp(name->getCString() + n - 7, "REGULAR")) { + name->del(n - 7, 7); n -= 7; - } else if (n >= 5 && !strcmp(nameA->getCString() + n - 5, "ROMAN")) { - nameA->del(n - 5, 5); + } else if (n >= 5 && !strcmp(name->getCString() + n - 5, "ROMAN")) { + name->del(n - 5, 5); n -= 5; } else { break; @@ -657,7 +659,7 @@ GlobalParams::GlobalParams(const char *cfgFileName) { base14SysFonts = new GHash(gTrue); sysFonts = new SysFontList(); #if HAVE_PAPER_H - const char *paperName; + char *paperName; const struct paper *paperType; paperinit(); if ((paperName = systempapername())) { @@ -713,21 +715,6 @@ GlobalParams::GlobalParams(const char *cfgFileName) { textKeepTinyChars = gTrue; initialZoom = new GString("125"); defaultFitZoom = 0; - zoomScaleFactor = 1; - zoomValues = new GList(); - zoomValues->append(new GString("25")); - zoomValues->append(new GString("50")); - zoomValues->append(new GString("75")); - zoomValues->append(new GString("100")); - zoomValues->append(new GString("110")); - zoomValues->append(new GString("125")); - zoomValues->append(new GString("150")); - zoomValues->append(new GString("175")); - zoomValues->append(new GString("200")); - zoomValues->append(new GString("300")); - zoomValues->append(new GString("400")); - zoomValues->append(new GString("600")); - zoomValues->append(new GString("800")); initialDisplayMode = new GString("continuous"); initialToolbarState = gTrue; initialSidebarState = gTrue; @@ -761,7 +748,6 @@ GlobalParams::GlobalParams(const char *cfgFileName) { fullScreenMatteColor = new GString("#000000"); selectionColor = new GString("#8080ff"); reverseVideoInvertImages = gFalse; - allowLinksToChangeZoom = gTrue; launchCommand = NULL; movieCommand = NULL; defaultPrinter = NULL; @@ -769,15 +755,10 @@ GlobalParams::GlobalParams(const char *cfgFileName) { mapUnknownCharNames = gFalse; mapExtTrueTypeFontsViaUnicode = gTrue; useTrueTypeUnicodeMapping = gFalse; - ignoreWrongSizeToUnicode = gFalse; droppedFonts = new GHash(gTrue); - separateRotatedText = gFalse; createDefaultKeyBindings(); popupMenuCmds = new GList(); -#ifndef PDF_PARSER_ONLY - initStateFilePaths(); -#endif - saveSessionOnQuit = gTrue; + tabStateFile = appendToPath(getHomeDir(), ".xpdf.tab-state"); savePageNumbers = gTrue; printCommands = gFalse; printStatusInfo = gFalse; @@ -1036,27 +1017,6 @@ void GlobalParams::createDefaultKeyBindings() { xpdfKeyContextAny, "zoomFitWidth")); } -#ifndef PDF_PARSER_ONLY -void GlobalParams::initStateFilePaths() { -#ifdef _WIN32 - char path[MAX_PATH]; - if (SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, - SHGFP_TYPE_CURRENT, path) != S_OK) { - return; - } - GString *dir = appendToPath(new GString(path), "xpdf"); - CreateDirectoryA(dir->getCString(), NULL); - pagesFile = appendToPath(dir->copy(), "xpdf.pages"); - tabStateFile = appendToPath(dir->copy(), "xpdf.tab-state"); - sessionFile = appendToPath(dir, "xpdf.session"); -#else - pagesFile = appendToPath(getHomeDir(), ".xpdf.pages"); - tabStateFile = appendToPath(getHomeDir(), ".xpdf.tab-state"); - sessionFile = appendToPath(getHomeDir(), ".xpdf.session"); -#endif -} -#endif - void GlobalParams::parseFile(GString *fileName, FILE *f) { int line; char buf[512]; @@ -1197,10 +1157,6 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { parseString("initialZoom", &initialZoom, tokens, fileName, line); } else if (!cmd->cmp("defaultFitZoom")) { parseInteger("defaultFitZoom", &defaultFitZoom, tokens, fileName, line); - } else if (!cmd->cmp("zoomScaleFactor")) { - parseZoomScaleFactor(tokens, fileName, line); - } else if (!cmd->cmp("zoomValues")) { - parseZoomValues(tokens, fileName, line); } else if (!cmd->cmp("initialDisplayMode")) { parseString("initialDisplayMode", &initialDisplayMode, tokens, fileName, line); @@ -1288,9 +1244,6 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { } else if (!cmd->cmp("reverseVideoInvertImages")) { parseYesNo("reverseVideoInvertImages", &reverseVideoInvertImages, tokens, fileName, line); - } else if (!cmd->cmp("allowLinksToChangeZoom")) { - parseYesNo("allowLinksToChangeZoom", &allowLinksToChangeZoom, - tokens, fileName, line); } else if (!cmd->cmp("launchCommand")) { parseString("launchCommand", &launchCommand, tokens, fileName, line); } else if (!cmd->cmp("movieCommand")) { @@ -1308,16 +1261,11 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { &mapExtTrueTypeFontsViaUnicode, tokens, fileName, line); } else if (!cmd->cmp("useTrueTypeUnicodeMapping")) { - parseYesNo("useTrueTypeUnicodeMapping", &useTrueTypeUnicodeMapping, - tokens, fileName, line); - } else if (!cmd->cmp("ignoreWrongSizeToUnicode")) { - parseYesNo("ignoreWrongSizeToUnicode", &ignoreWrongSizeToUnicode, + parseYesNo("useTrueTypeUnicodeMapping", + &useTrueTypeUnicodeMapping, tokens, fileName, line); } else if (!cmd->cmp("dropFont")) { parseDropFont(tokens, fileName, line); - } else if (!cmd->cmp("separateRotatedText")) { - parseYesNo("separateRotatedText", &separateRotatedText, - tokens, fileName, line); } else if (!cmd->cmp("bind")) { parseBind(tokens, fileName, line); } else if (!cmd->cmp("unbind")) { @@ -1326,11 +1274,6 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { parsePopupMenuCmd(tokens, fileName, line); } else if (!cmd->cmp("tabStateFile")) { parseString("tabStateFile", &tabStateFile, tokens, fileName, line); - } else if (!cmd->cmp("sessionFile")) { - parseString("sessionFile", &sessionFile, tokens, fileName, line); - } else if (!cmd->cmp("saveSessionOnQuit")) { - parseYesNo("saveSessionOnQuit", &saveSessionOnQuit, - tokens, fileName, line); } else if (!cmd->cmp("savePageNumbers")) { parseYesNo("savePageNumbers", &savePageNumbers, tokens, fileName, line); } else if (!cmd->cmp("printCommands")) { @@ -2030,59 +1973,6 @@ void GlobalParams::parsePopupMenuCmd(GList *tokens, cmds)); } -void GlobalParams::parseZoomScaleFactor(GList *tokens, - GString *fileName, int line) { - if (tokens->getLength() != 2) { - error(errConfig, -1, "Bad 'zoomScaleFactor' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - GString *tok = (GString *)tokens->get(1); - if (tok->getLength() == 0) { - error(errConfig, -1, "Bad 'zoomScaleFactor' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - if (tok->cmp("actual") == 0) { - zoomScaleFactor = -1; - } else { - for (int i = 0; i < tok->getLength(); ++i) { - if (!((tok->getChar(i) >= '0' && tok->getChar(i) <= '9') || - tok->getChar(i) == '.')) { - error(errConfig, -1, "Bad 'zoomScaleFactor' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - } - zoomScaleFactor = atof(tok->getCString()); - } -} - -void GlobalParams::parseZoomValues(GList *tokens, - GString *fileName, int line) { - if (tokens->getLength() < 2) { - error(errConfig, -1, "Bad 'zoomValues' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - for (int i = 1; i < tokens->getLength(); ++i) { - GString *tok = (GString *)tokens->get(i); - for (int j = 0; j < tok->getLength(); ++j) { - if (tok->getChar(j) < '0' || tok->getChar(j) > '9') { - error(errConfig, -1, "Bad 'zoomValues' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - } - } - deleteGList(zoomValues, GString); - zoomValues = new GList(); - for (int i = 1; i < tokens->getLength(); ++i) { - GString *tok = (GString *)tokens->get(i); - zoomValues->append(tok->copy()); - } -} - void GlobalParams::parseYesNo(const char *cmdName, GBool *flag, GList *tokens, GString *fileName, int line) { GString *tok; @@ -2214,7 +2104,6 @@ GlobalParams::~GlobalParams() { deleteGList(psResidentFontsCC, PSFontParam16); delete textEncoding; delete initialZoom; - deleteGList(zoomValues, GString); delete initialDisplayMode; delete initialSelectMode; if (paperColor) { @@ -2241,9 +2130,7 @@ GlobalParams::~GlobalParams() { delete droppedFonts; deleteGList(keyBindings, KeyBinding); deleteGList(popupMenuCmds, PopupMenuCmd); - delete pagesFile; delete tabStateFile; - delete sessionFile; delete debugLogFile; cMapDirs->startIter(&iter); @@ -3072,19 +2959,6 @@ int GlobalParams::getDefaultFitZoom() { return z; } -double GlobalParams::getZoomScaleFactor() { - double z; - - lockGlobalParams; - z = zoomScaleFactor; - unlockGlobalParams; - return z; -} - -GList *GlobalParams::getZoomValues() { - return zoomValues; -} - GString *GlobalParams::getInitialDisplayMode() { GString *s; @@ -3376,15 +3250,6 @@ GBool GlobalParams::getReverseVideoInvertImages() { return invert; } -GBool GlobalParams::getAllowLinksToChangeZoom() { - GBool allow; - - lockGlobalParams; - allow = allowLinksToChangeZoom; - unlockGlobalParams; - return allow; -} - GString *GlobalParams::getDefaultPrinter() { GString *s; @@ -3430,15 +3295,6 @@ GBool GlobalParams::getUseTrueTypeUnicodeMapping() { return use; } -GBool GlobalParams::getIgnoreWrongSizeToUnicode() { - GBool ignore; - - lockGlobalParams; - ignore = ignoreWrongSizeToUnicode; - unlockGlobalParams; - return ignore; -} - GBool GlobalParams::isDroppedFont(const char *fontName) { GBool isDropped; @@ -3448,15 +3304,6 @@ GBool GlobalParams::isDroppedFont(const char *fontName) { return isDropped; } -GBool GlobalParams::getSeparateRotatedText() { - GBool sep; - - lockGlobalParams; - sep = separateRotatedText; - unlockGlobalParams; - return sep; -} - GList *GlobalParams::getKeyBinding(int code, int mods, int context) { KeyBinding *binding; GList *cmds; @@ -3509,15 +3356,6 @@ PopupMenuCmd *GlobalParams::getPopupMenuCmd(int idx) { return cmd; } -GString *GlobalParams::getPagesFile() { - GString *s; - - lockGlobalParams; - s = pagesFile->copy(); - unlockGlobalParams; - return s; -} - GString *GlobalParams::getTabStateFile() { GString *s; @@ -3527,15 +3365,6 @@ GString *GlobalParams::getTabStateFile() { return s; } -GString *GlobalParams::getSessionFile() { - GString *s; - - lockGlobalParams; - s = sessionFile->copy(); - unlockGlobalParams; - return s; -} - GBool GlobalParams::getSavePageNumbers() { GBool s; @@ -3545,15 +3374,6 @@ GBool GlobalParams::getSavePageNumbers() { return s; } -GBool GlobalParams::getSaveSessionOnQuit() { - GBool s; - - lockGlobalParams; - s = saveSessionOnQuit; - unlockGlobalParams; - return s; -} - GBool GlobalParams::getPrintCommands() { GBool p; @@ -3892,12 +3712,6 @@ void GlobalParams::setInitialZoom(char *s) { unlockGlobalParams; } -void GlobalParams::setDefaultFitZoom(int z) { - lockGlobalParams; - defaultFitZoom = z; - unlockGlobalParams; -} - GBool GlobalParams::setEnableFreeType(char *s) { GBool ok; @@ -4001,13 +3815,6 @@ void GlobalParams::setTabStateFile(char *tabStateFileA) { unlockGlobalParams; } -void GlobalParams::setSessionFile(char *sessionFileA) { - lockGlobalParams; - delete sessionFile; - sessionFile = new GString(sessionFileA); - unlockGlobalParams; -} - void GlobalParams::setPrintCommands(GBool printCommandsA) { lockGlobalParams; printCommands = printCommandsA; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h index c9b4c7bdc09..d72473f2a46 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h @@ -14,6 +14,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include #ifdef _WIN32 # include @@ -299,8 +303,6 @@ public: GBool getTextKeepTinyChars(); GString *getInitialZoom(); int getDefaultFitZoom(); - double getZoomScaleFactor(); - GList *getZoomValues(); GString *getInitialDisplayMode(); GBool getInitialToolbarState(); GBool getInitialSidebarState(); @@ -334,7 +336,6 @@ public: GString *getFullScreenMatteColor(); GString *getSelectionColor(); GBool getReverseVideoInvertImages(); - GBool getAllowLinksToChangeZoom(); GString *getLaunchCommand() { return launchCommand; } GString *getMovieCommand() { return movieCommand; } GString *getDefaultPrinter(); @@ -342,17 +343,12 @@ public: GBool getMapUnknownCharNames(); GBool getMapExtTrueTypeFontsViaUnicode(); GBool getUseTrueTypeUnicodeMapping(); - GBool getIgnoreWrongSizeToUnicode(); GBool isDroppedFont(const char *fontName); - GBool getSeparateRotatedText(); GList *getKeyBinding(int code, int mods, int context); GList *getAllKeyBindings(); int getNumPopupMenuCmds(); PopupMenuCmd *getPopupMenuCmd(int idx); - GString *getPagesFile(); GString *getTabStateFile(); - GString *getSessionFile(); - GBool getSaveSessionOnQuit(); GBool getSavePageNumbers(); GBool getPrintCommands(); GBool getPrintStatusInfo(); @@ -394,7 +390,6 @@ public: void setTextPageBreaks(GBool pageBreaks); void setTextKeepTinyChars(GBool keep); void setInitialZoom(char *s); - void setDefaultFitZoom(int z); GBool setEnableFreeType(char *s); GBool setAntialias(char *s); GBool setVectorAntialias(char *s); @@ -410,7 +405,6 @@ public: void setMapUnknownCharNames(GBool map); void setMapExtTrueTypeFontsViaUnicode(GBool map); void setTabStateFile(char *tabStateFileA); - void setSessionFile(char *sessionFileA); void setPrintCommands(GBool printCommandsA); void setPrintStatusInfo(GBool printStatusInfoA); void setErrQuiet(GBool errQuietA); @@ -426,9 +420,6 @@ private: void setDataDirVar(); void createDefaultKeyBindings(); -#ifndef PDF_PARSER_ONLY - void initStateFilePaths(); -#endif void parseFile(GString *fileName, FILE *f); GList *parseLineTokens(char *buf, GString *fileName, int line); void parseNameToUnicode(GList *tokens, GString *fileName, int line); @@ -459,8 +450,6 @@ private: const char *cmdName, GList *tokens, GString *fileName, int line); void parsePopupMenuCmd(GList *tokens, GString *fileName, int line); - void parseZoomScaleFactor(GList *tokens, GString *fileName, int line); - void parseZoomValues(GList *tokens, GString *fileName, int line); void parseYesNo(const char *cmdName, GBool *flag, GList *tokens, GString *fileName, int line); GBool parseYesNo2(char *token, GBool *flag); @@ -559,9 +548,7 @@ private: GBool textKeepTinyChars; // keep all characters in text output GString *initialZoom; // initial zoom level int defaultFitZoom; // default zoom factor if initialZoom is - // 'page' or 'width' - double zoomScaleFactor; // displayed zoom values are scaled by this - GList *zoomValues; // zoom values for the combo box + // 'page' or 'width'. GString *initialDisplayMode; // initial display mode (single, // continuous, etc.) GBool initialToolbarState; // initial toolbar state - open (true) @@ -599,7 +586,6 @@ private: GString *fullScreenMatteColor; // matte color in full-screen mode GString *selectionColor; // selection color GBool reverseVideoInvertImages; // invert images in reverse video mode - GBool allowLinksToChangeZoom; // allow clicking on a link to change the zoom GString *launchCommand; // command executed for 'launch' links GString *movieCommand; // command executed for movie annotations GString *defaultPrinter; // default printer (for interactive printing @@ -611,16 +597,10 @@ private: GBool useTrueTypeUnicodeMapping; // use the Unicode cmaps in TrueType // fonts, rather than the PDF // ToUnicode mapping - GBool ignoreWrongSizeToUnicode; // ignore ToUnicode CMaps if their size - // (8-bit vs 16-bit) doesn't match the font GHash *droppedFonts; // dropped fonts [int] - GBool separateRotatedText; // separate text at each rotation GList *keyBindings; // key & mouse button bindings [KeyBinding] GList *popupMenuCmds; // popup menu commands [PopupMenuCmd] - GString *pagesFile; // path for the page number save file GString *tabStateFile; // path for the tab state save file - GString *sessionFile; // path for the session save file - GBool saveSessionOnQuit; // save session info when xpdf is quit GBool savePageNumbers; // save page number when file is closed // and restore page number when opened GBool printCommands; // print the drawing commands diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc index 0183d3a14f4..a077655ef43 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc @@ -21,6 +21,10 @@ #include +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include #include #include "gmem.h" @@ -31,7 +35,6 @@ #include "PDFDoc.h" #include "GfxFont.h" #include "AcroForm.h" -#include "TextString.h" #include "TextOutputDev.h" #include "SplashOutputDev.h" #include "ErrorCodes.h" @@ -39,11 +42,9 @@ #include "HTMLGen.h" #ifdef _WIN32 -#ifndef __GNUC__ # define strcasecmp stricmp # define strncasecmp strnicmp #endif -#endif //------------------------------------------------------------------------ @@ -296,7 +297,6 @@ HTMLGen::HTMLGen(double backgroundResolutionA, GBool tableMode) { convertFormFields = gFalse; embedBackgroundImage = gFalse; embedFonts = gFalse; - includeMetadata = gFalse; // set up the TextOutputDev textOutControl.mode = tableMode ? textOutTableLayout : textOutReadingOrder; @@ -312,10 +312,6 @@ HTMLGen::HTMLGen(double backgroundResolutionA, GBool tableMode) { splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor); fontDefns = NULL; - - nVisibleChars = 0; - nInvisibleChars = 0; - nRemovedDupChars = 0; } HTMLGen::~HTMLGen() { @@ -466,11 +462,11 @@ int HTMLGen::convertPage( llyI = bitmap->getHeight() - 1; } if (uryI <= llyI && llxI <= urxI) { - SplashColorPtr pix = bitmap->getDataPtr() - + uryI * bitmap->getRowSize() + llxI * 3; - for (y = uryI; y <= llyI; ++y) { - memset(pix, 0xff, (urxI - llxI + 1) * 3); - pix += bitmap->getRowSize(); + SplashColorPtr p = bitmap->getDataPtr() + + uryI * bitmap->getRowSize() + llxI * 3; + for (int y = uryI; y <= llyI; ++y) { + memset(p, 0xff, (urxI - llxI + 1) * 3); + p += bitmap->getRowSize(); } } @@ -487,9 +483,6 @@ int HTMLGen::convertPage( pr(writeHTML, htmlStream, "\n"); pr(writeHTML, htmlStream, "\n"); pr(writeHTML, htmlStream, "\n"); - if (includeMetadata) { - genDocMetadata(writeHTML, htmlStream); - } pr(writeHTML, htmlStream, "