node-poppler 5.1.4 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/README.md +2 -0
  2. package/package.json +13 -13
  3. package/src/index.js +20 -8
  4. package/API.md +0 -465
  5. package/CHANGELOG.md +0 -976
  6. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Annot.h +0 -1783
  7. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/AnnotStampImageHelper.h +0 -68
  8. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Array.h +0 -92
  9. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/BBoxOutputDev.h +0 -54
  10. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CMap.h +0 -128
  11. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CachedFile.h +0 -149
  12. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoFontEngine.h +0 -122
  13. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoOutputDev.h +0 -468
  14. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoRescaleBox.h +0 -60
  15. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Catalog.h +0 -318
  16. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CertificateInfo.h +0 -129
  17. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharCodeToUnicode.h +0 -143
  18. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharTypes.h +0 -24
  19. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlCachedFile.h +0 -37
  20. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlPDFDocBuilder.h +0 -32
  21. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/DateInfo.h +0 -44
  22. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Decrypt.h +0 -147
  23. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Dict.h +0 -126
  24. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Error.h +0 -59
  25. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ErrorCodes.h +0 -54
  26. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FDPDFDocBuilder.h +0 -36
  27. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FILECacheLoader.h +0 -34
  28. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FileSpec.h +0 -85
  29. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontEncodingTables.h +0 -20
  30. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontInfo.h +0 -109
  31. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Form.h +0 -734
  32. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Function.h +0 -251
  33. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Gfx.h +0 -373
  34. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxFont.h +0 -466
  35. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState.h +0 -1759
  36. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState_helpers.h +0 -90
  37. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GlobalParams.h +0 -221
  38. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Hints.h +0 -91
  39. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JArithmeticDecoder.h +0 -131
  40. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JBIG2Stream.h +0 -130
  41. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JPEG2000Stream.h +0 -54
  42. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JSInfo.h +0 -65
  43. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Lexer.h +0 -113
  44. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Linearization.h +0 -43
  45. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Link.h +0 -566
  46. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/LocalPDFDocBuilder.h +0 -32
  47. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/MarkedContentOutputDev.h +0 -132
  48. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Movie.h +0 -123
  49. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToCharCode.h +0 -52
  50. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToUnicodeTable.h +0 -4300
  51. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Object.h +0 -678
  52. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OptionalContent.h +0 -117
  53. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Outline.h +0 -122
  54. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OutputDev.h +0 -379
  55. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDoc.h +0 -419
  56. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocBuilder.h +0 -47
  57. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocEncoding.h +0 -43
  58. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocFactory.h +0 -58
  59. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSOutputDev.h +0 -549
  60. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSTokenizer.h +0 -47
  61. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Page.h +0 -273
  62. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PageTransition.h +0 -105
  63. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Parser.h +0 -76
  64. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PopplerCache.h +0 -65
  65. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PreScanOutputDev.h +0 -148
  66. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ProfileData.h +0 -35
  67. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Rendition.h +0 -164
  68. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SecurityHandler.h +0 -131
  69. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Sound.h +0 -82
  70. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SplashOutputDev.h +0 -413
  71. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream-CCITT.h +0 -334
  72. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream.h +0 -1504
  73. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructElement.h +0 -406
  74. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructTreeRoot.h +0 -89
  75. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/TextOutputDev.h +0 -918
  76. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UTF.h +0 -112
  77. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCClassTables.h +0 -983
  78. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCompTables.h +0 -328
  79. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeDecompTables.h +0 -7181
  80. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMap.h +0 -128
  81. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapFuncs.h +0 -35
  82. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapTables.h +0 -84
  83. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeTypeTable.h +0 -49
  84. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ViewerPreferences.h +0 -87
  85. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/XRef.h +0 -325
  86. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-destination.h +0 -69
  87. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-document.h +0 -135
  88. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-embedded-file.h +0 -55
  89. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font-private.h +0 -68
  90. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font.h +0 -95
  91. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-global.h +0 -132
  92. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-image.h +0 -74
  93. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-renderer.h +0 -77
  94. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-transition.h +0 -85
  95. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page.h +0 -225
  96. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-rectangle.h +0 -66
  97. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-toc.h +0 -72
  98. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-version.h +0 -39
  99. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler_cpp_export.h +0 -42
  100. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiBase.h +0 -66
  101. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiEncodings.h +0 -43
  102. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiIdentifier.h +0 -52
  103. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiTrueType.h +0 -190
  104. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1.h +0 -70
  105. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1C.h +0 -263
  106. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-action.h +0 -454
  107. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-annot.h +0 -333
  108. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-attachment.h +0 -123
  109. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-date.h +0 -32
  110. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-document.h +0 -541
  111. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-enums.h +0 -191
  112. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-features.h +0 -88
  113. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-form-field.h +0 -254
  114. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-layer.h +0 -50
  115. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-macros.h +0 -42
  116. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-media.h +0 -80
  117. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-movie.h +0 -81
  118. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-page.h +0 -424
  119. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-structure-element.h +0 -425
  120. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler.h +0 -259
  121. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooCheckedOps.h +0 -116
  122. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooLikely.h +0 -22
  123. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooString.h +0 -262
  124. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooTimer.h +0 -59
  125. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/ImgWriter.h +0 -39
  126. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/JpegWriter.h +0 -69
  127. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/PNGWriter.h +0 -68
  128. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/TiffWriter.h +0 -70
  129. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gdir.h +0 -96
  130. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gfile.h +0 -156
  131. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gmem.h +0 -201
  132. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/grandom.h +0 -21
  133. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gstrtod.h +0 -45
  134. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler-config.h +0 -155
  135. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler_private_export.h +0 -42
  136. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/Splash.h +0 -336
  137. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashBitmap.h +0 -127
  138. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashClip.h +0 -131
  139. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashErrorCodes.h +0 -50
  140. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFont.h +0 -71
  141. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontEngine.h +0 -72
  142. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontFile.h +0 -64
  143. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFont.h +0 -116
  144. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontEngine.h +0 -89
  145. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFile.h +0 -98
  146. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFileID.h +0 -40
  147. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashGlyphBitmap.h +0 -23
  148. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashMath.h +0 -215
  149. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPath.h +0 -138
  150. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPattern.h +0 -107
  151. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashScreen.h +0 -87
  152. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashState.h +0 -132
  153. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashTypes.h +0 -248
  154. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPath.h +0 -95
  155. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPathScanner.h +0 -136
  156. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-cpp.pc +0 -12
  157. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-glib.pc +0 -12
  158. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler.pc +0 -10
  159. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-cpp.lib +0 -0
  160. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-glib.lib +0 -0
  161. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler.lib +0 -0
  162. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfattach.1 +0 -60
  163. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfdetach.1 +0 -94
  164. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdffonts.1 +0 -128
  165. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfimages.1 +0 -265
  166. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfinfo.1 +0 -198
  167. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfseparate.1 +0 -60
  168. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftocairo.1 +0 -346
  169. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftohtml.1 +0 -118
  170. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftoppm.1 +0 -230
  171. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftops.1 +0 -267
  172. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftotext.1 +0 -157
  173. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfunite.1 +0 -43
  174. package/src/lib/win32/poppler-22.04.0/share/poppler/CMakeLists.txt +0 -309
  175. package/src/lib/win32/poppler-22.04.0/share/poppler/Makefile +0 -333
  176. package/tsconfig.json +0 -9
@@ -1,263 +0,0 @@
1
- //========================================================================
2
- //
3
- // FoFiType1C.h
4
- //
5
- // Copyright 1999-2003 Glyph & Cog, LLC
6
- //
7
- //========================================================================
8
-
9
- //========================================================================
10
- //
11
- // Modified under the Poppler project - http://poppler.freedesktop.org
12
- //
13
- // All changes made under the Poppler project to this file are licensed
14
- // under GPL version 2 or later
15
- //
16
- // Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
17
- // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag@alfa.de>
18
- // Copyright (C) 2018-2020 Albert Astals Cid <aacid@kde.org>
19
- // Copyright (C) 2022 Oliver Sander <oliver.sander@tu-dresden.de>
20
- //
21
- // To see a description of the changes please see the Changelog file that
22
- // came with your tarball or type make ChangeLog if you are building from git
23
- //
24
- //========================================================================
25
-
26
- #ifndef FOFITYPE1C_H
27
- #define FOFITYPE1C_H
28
-
29
- #include "FoFiBase.h"
30
-
31
- #include "poppler_private_export.h"
32
-
33
- #include <set>
34
-
35
- class GooString;
36
-
37
- //------------------------------------------------------------------------
38
-
39
- struct Type1CIndex
40
- {
41
- int pos; // absolute position in file
42
- int len; // length (number of entries)
43
- int offSize; // offset size
44
- int startPos; // position of start of index data - 1
45
- int endPos; // position one byte past end of the index
46
- };
47
-
48
- struct Type1CIndexVal
49
- {
50
- int pos; // absolute position in file
51
- int len; // length, in bytes
52
- };
53
-
54
- struct Type1CTopDict
55
- {
56
- int firstOp;
57
-
58
- int versionSID;
59
- int noticeSID;
60
- int copyrightSID;
61
- int fullNameSID;
62
- int familyNameSID;
63
- int weightSID;
64
- int isFixedPitch;
65
- double italicAngle;
66
- double underlinePosition;
67
- double underlineThickness;
68
- int paintType;
69
- int charstringType;
70
- double fontMatrix[6];
71
- bool hasFontMatrix; // CID fonts are allowed to put their
72
- // FontMatrix in the FD instead of the
73
- // top dict
74
- int uniqueID;
75
- double fontBBox[4];
76
- double strokeWidth;
77
- int charsetOffset;
78
- int encodingOffset;
79
- int charStringsOffset;
80
- int privateSize;
81
- int privateOffset;
82
-
83
- // CIDFont entries
84
- int registrySID;
85
- int orderingSID;
86
- int supplement;
87
- int fdArrayOffset;
88
- int fdSelectOffset;
89
- };
90
-
91
- #define type1CMaxBlueValues 14
92
- #define type1CMaxOtherBlues 10
93
- #define type1CMaxStemSnap 12
94
-
95
- struct Type1CPrivateDict
96
- {
97
- double fontMatrix[6];
98
- bool hasFontMatrix;
99
- int blueValues[type1CMaxBlueValues];
100
- int nBlueValues;
101
- int otherBlues[type1CMaxOtherBlues];
102
- int nOtherBlues;
103
- int familyBlues[type1CMaxBlueValues];
104
- int nFamilyBlues;
105
- int familyOtherBlues[type1CMaxOtherBlues];
106
- int nFamilyOtherBlues;
107
- double blueScale;
108
- int blueShift;
109
- int blueFuzz;
110
- double stdHW;
111
- bool hasStdHW;
112
- double stdVW;
113
- bool hasStdVW;
114
- double stemSnapH[type1CMaxStemSnap];
115
- int nStemSnapH;
116
- double stemSnapV[type1CMaxStemSnap];
117
- int nStemSnapV;
118
- bool forceBold;
119
- bool hasForceBold;
120
- double forceBoldThreshold;
121
- int languageGroup;
122
- double expansionFactor;
123
- int initialRandomSeed;
124
- int subrsOffset;
125
- double defaultWidthX;
126
- bool defaultWidthXFP;
127
- double nominalWidthX;
128
- bool nominalWidthXFP;
129
- };
130
-
131
- struct Type1COp
132
- {
133
- bool isNum = true; // true -> number, false -> operator
134
- bool isFP = false; // true -> floating point number, false -> int
135
- union {
136
- double num = 0; // if num is true
137
- int op; // if num is false
138
- };
139
- };
140
-
141
- struct Type1CEexecBuf
142
- {
143
- FoFiOutputFunc outputFunc;
144
- void *outputStream;
145
- bool ascii; // ASCII encoding?
146
- unsigned short r1; // eexec encryption key
147
- int line; // number of eexec chars left on current line
148
- };
149
-
150
- //------------------------------------------------------------------------
151
- // FoFiType1C
152
- //------------------------------------------------------------------------
153
-
154
- class POPPLER_PRIVATE_EXPORT FoFiType1C : public FoFiBase
155
- {
156
- public:
157
- // Create a FoFiType1C object from a memory buffer.
158
- static FoFiType1C *make(const unsigned char *fileA, int lenA);
159
-
160
- // Create a FoFiType1C object from a file on disk.
161
- static FoFiType1C *load(const char *fileName);
162
-
163
- ~FoFiType1C() override;
164
-
165
- // Return the font name.
166
- const char *getName() const;
167
-
168
- // Return the encoding, as an array of 256 names (any of which may
169
- // be NULL). This is only useful with 8-bit fonts.
170
- char **getEncoding() const;
171
-
172
- // Get the glyph names.
173
- int getNumGlyphs() const { return nGlyphs; }
174
- GooString *getGlyphName(int gid) const;
175
-
176
- // Return the mapping from CIDs to GIDs, and return the number of
177
- // CIDs in *<nCIDs>. This is only useful for CID fonts.
178
- int *getCIDToGIDMap(int *nCIDs) const;
179
-
180
- // Return the font matrix as an array of six numbers.
181
- void getFontMatrix(double *mat) const;
182
-
183
- // Convert to a Type 1 font, suitable for embedding in a PostScript
184
- // file. This is only useful with 8-bit fonts. If <newEncoding> is
185
- // not NULL, it will be used in place of the encoding in the Type 1C
186
- // font. If <ascii> is true the eexec section will be hex-encoded,
187
- // otherwise it will be left as binary data. If <psName> is non-NULL,
188
- // it will be used as the PostScript font name.
189
- void convertToType1(const char *psName, const char **newEncoding, bool ascii, FoFiOutputFunc outputFunc, void *outputStream);
190
-
191
- // Convert to a Type 0 CIDFont, suitable for embedding in a
192
- // PostScript file. <psName> will be used as the PostScript font
193
- // name. There are three cases for the CID-to-GID mapping:
194
- // (1) if <codeMap> is non-NULL, then it is the CID-to-GID mapping
195
- // (2) if <codeMap> is NULL and this is a CID CFF font, then the
196
- // font's internal CID-to-GID mapping is used
197
- // (3) is <codeMap> is NULL and this is an 8-bit CFF font, then
198
- // the identity CID-to-GID mapping is used
199
- void convertToCIDType0(const char *psName, const int *codeMap, int nCodes, FoFiOutputFunc outputFunc, void *outputStream);
200
-
201
- // Convert to a Type 0 (but non-CID) composite font, suitable for
202
- // embedding in a PostScript file. <psName> will be used as the
203
- // PostScript font name. There are three cases for the CID-to-GID
204
- // mapping:
205
- // (1) if <codeMap> is non-NULL, then it is the CID-to-GID mapping
206
- // (2) if <codeMap> is NULL and this is a CID CFF font, then the
207
- // font's internal CID-to-GID mapping is used
208
- // (3) is <codeMap> is NULL and this is an 8-bit CFF font, then
209
- // the identity CID-to-GID mapping is used
210
- void convertToType0(const char *psName, const int *codeMap, int nCodes, FoFiOutputFunc outputFunc, void *outputStream);
211
-
212
- private:
213
- FoFiType1C(const unsigned char *fileA, int lenA, bool freeFileDataA);
214
- void eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName, int offset, int nBytes, const Type1CIndex *subrIdx, const Type1CPrivateDict *pDict);
215
- void cvtGlyph(int offset, int nBytes, GooString *charBuf, const Type1CIndex *subrIdx, const Type1CPrivateDict *pDict, bool top, std::set<int> &offsetBeingParsed);
216
- void cvtGlyphWidth(bool useOp, GooString *charBuf, const Type1CPrivateDict *pDict);
217
- void cvtNum(double x, bool isFP, GooString *charBuf) const;
218
- void eexecWrite(Type1CEexecBuf *eb, const char *s) const;
219
- void eexecWriteCharstring(Type1CEexecBuf *eb, const unsigned char *s, int n) const;
220
- void writePSString(const char *s, FoFiOutputFunc outputFunc, void *outputStream) const;
221
- bool parse();
222
- void readTopDict();
223
- void readFD(int offset, int length, Type1CPrivateDict *pDict);
224
- void readPrivateDict(int offset, int length, Type1CPrivateDict *pDict);
225
- void readFDSelect();
226
- void buildEncoding();
227
- bool readCharset();
228
- int getOp(int pos, bool charstring, bool *ok);
229
- int getDeltaIntArray(int *arr, int maxLen) const;
230
- int getDeltaFPArray(double *arr, int maxLen) const;
231
- void getIndex(int pos, Type1CIndex *idx, bool *ok) const;
232
- void getIndexVal(const Type1CIndex *idx, int i, Type1CIndexVal *val, bool *ok) const;
233
- char *getString(int sid, char *buf, bool *ok) const;
234
-
235
- GooString *name;
236
- char **encoding;
237
-
238
- Type1CIndex nameIdx;
239
- Type1CIndex topDictIdx;
240
- Type1CIndex stringIdx;
241
- Type1CIndex gsubrIdx;
242
- Type1CIndex charStringsIdx;
243
-
244
- Type1CTopDict topDict;
245
- Type1CPrivateDict *privateDicts;
246
-
247
- int nGlyphs;
248
- int nFDs;
249
- unsigned char *fdSelect;
250
- const unsigned short *charset;
251
- unsigned short charsetLength;
252
- int gsubrBias;
253
-
254
- bool parsedOk;
255
-
256
- Type1COp ops[49]; // operands and operator
257
- int nOps; // number of operands
258
- int nHints; // number of hints for the current glyph
259
- bool firstOp; // true if we haven't hit the first op yet
260
- bool openPath; // true if there is an unclosed path
261
- };
262
-
263
- #endif
@@ -1,454 +0,0 @@
1
- /* poppler-action.h: glib interface to poppler
2
- * Copyright (C) 2004, Red Hat, Inc.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2, or (at your option)
7
- * any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, write to the Free Software
16
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17
- */
18
-
19
- #ifndef __POPPLER_ACTION_H__
20
- #define __POPPLER_ACTION_H__
21
-
22
- #include <glib-object.h>
23
- #include "poppler.h"
24
-
25
- G_BEGIN_DECLS
26
-
27
- /**
28
- * PopplerActionType:
29
- * @POPPLER_ACTION_UNKNOWN: unknown action
30
- * @POPPLER_ACTION_NONE: no action specified
31
- * @POPPLER_ACTION_GOTO_DEST: go to destination
32
- * @POPPLER_ACTION_GOTO_REMOTE: go to destination in another document
33
- * @POPPLER_ACTION_LAUNCH: launch app (or open document)
34
- * @POPPLER_ACTION_URI: URI
35
- * @POPPLER_ACTION_NAMED: predefined action
36
- * @POPPLER_ACTION_MOVIE: play movies. Since 0.14
37
- * @POPPLER_ACTION_RENDITION: play multimedia content. Since 0.14
38
- * @POPPLER_ACTION_OCG_STATE: state of layer. Since 0.14
39
- * @POPPLER_ACTION_JAVASCRIPT: Javascript. Since 0.18
40
- * @POPPLER_ACTION_RESET_FORM: resets form. Since 0.90
41
- *
42
- * Action types
43
- */
44
- typedef enum
45
- {
46
- POPPLER_ACTION_UNKNOWN, /* unknown action */
47
- POPPLER_ACTION_NONE, /* no action specified */
48
- POPPLER_ACTION_GOTO_DEST, /* go to destination */
49
- POPPLER_ACTION_GOTO_REMOTE, /* go to destination in new file */
50
- POPPLER_ACTION_LAUNCH, /* launch app (or open document) */
51
- POPPLER_ACTION_URI, /* URI */
52
- POPPLER_ACTION_NAMED, /* named action*/
53
- POPPLER_ACTION_MOVIE, /* movie action */
54
- POPPLER_ACTION_RENDITION, /* rendition action */
55
- POPPLER_ACTION_OCG_STATE, /* Set-OCG-State action */
56
- POPPLER_ACTION_JAVASCRIPT, /* Javascript action */
57
- POPPLER_ACTION_RESET_FORM /* ResetForm action */
58
- } PopplerActionType;
59
-
60
- /**
61
- * PopplerDestType:
62
- * @POPPLER_DEST_UNKNOWN: unknown destination
63
- * @POPPLER_DEST_XYZ: go to page with coordinates (left, top)
64
- * positioned at the upper-left corner of the window and the contents of
65
- * the page magnified by the factor zoom
66
- * @POPPLER_DEST_FIT: go to page with its contents magnified just
67
- * enough to fit the entire page within the window both horizontally and
68
- * vertically
69
- * @POPPLER_DEST_FITH: go to page with the vertical coordinate top
70
- * positioned at the top edge of the window and the contents of the page
71
- * magnified just enough to fit the entire width of the page within the window
72
- * @POPPLER_DEST_FITV: go to page with the horizontal coordinate
73
- * left positioned at the left edge of the window and the contents of the
74
- * page magnified just enough to fit the entire height of the page within the window
75
- * @POPPLER_DEST_FITR: go to page with its contents magnified just
76
- * enough to fit the rectangle specified by the coordinates left, bottom,
77
- * right, and top entirely within the window both horizontally and vertically
78
- * @POPPLER_DEST_FITB: go to page with its contents magnified just enough to fit
79
- * its bounding box entirely within the window both horizontally and vertically
80
- * @POPPLER_DEST_FITBH: go to page with the vertical
81
- * coordinate top positioned at the top edge of the window and the
82
- * contents of the page magnified just enough to fit the entire width of its
83
- * bounding box within the window
84
- * @POPPLER_DEST_FITBV: go to page with the horizontal
85
- * coordinate left positioned at the left edge of the window and the
86
- * contents of the page magnified just enough to fit the entire height of its
87
- * bounding box within the window
88
- * @POPPLER_DEST_NAMED: got to page specified by a name. See poppler_document_find_dest()
89
- *
90
- * Destination types
91
- */
92
- typedef enum
93
- {
94
- POPPLER_DEST_UNKNOWN,
95
- POPPLER_DEST_XYZ,
96
- POPPLER_DEST_FIT,
97
- POPPLER_DEST_FITH,
98
- POPPLER_DEST_FITV,
99
- POPPLER_DEST_FITR,
100
- POPPLER_DEST_FITB,
101
- POPPLER_DEST_FITBH,
102
- POPPLER_DEST_FITBV,
103
- POPPLER_DEST_NAMED
104
- } PopplerDestType;
105
-
106
- /**
107
- * PopplerActionMovieOperation:
108
- * @POPPLER_ACTION_MOVIE_PLAY: play movie
109
- * @POPPLER_ACTION_MOVIE_PAUSE: pause playing movie
110
- * @POPPLER_ACTION_MOVIE_RESUME: resume paused movie
111
- * @POPPLER_ACTION_MOVIE_STOP: stop playing movie
112
- *
113
- * Movie operations
114
- *
115
- * Since: 0.14
116
- */
117
- typedef enum
118
- {
119
- POPPLER_ACTION_MOVIE_PLAY,
120
- POPPLER_ACTION_MOVIE_PAUSE,
121
- POPPLER_ACTION_MOVIE_RESUME,
122
- POPPLER_ACTION_MOVIE_STOP
123
- } PopplerActionMovieOperation;
124
-
125
- /**
126
- * PopplerActionLayerAction:
127
- * @POPPLER_ACTION_LAYER_ON: set layer visibility on
128
- * @POPPLER_ACTION_LAYER_OFF: set layer visibility off
129
- * @POPPLER_ACTION_LAYER_TOGGLE: reverse the layer visibility state
130
- *
131
- * Layer actions
132
- *
133
- * Since: 0.14
134
- */
135
- typedef enum
136
- {
137
- POPPLER_ACTION_LAYER_ON,
138
- POPPLER_ACTION_LAYER_OFF,
139
- POPPLER_ACTION_LAYER_TOGGLE
140
- } PopplerActionLayerAction;
141
-
142
- /* Define the PopplerAction types */
143
- typedef struct _PopplerActionAny PopplerActionAny;
144
- typedef struct _PopplerActionGotoDest PopplerActionGotoDest;
145
- typedef struct _PopplerActionGotoRemote PopplerActionGotoRemote;
146
- typedef struct _PopplerActionLaunch PopplerActionLaunch;
147
- typedef struct _PopplerActionUri PopplerActionUri;
148
- typedef struct _PopplerActionNamed PopplerActionNamed;
149
- typedef struct _PopplerActionMovie PopplerActionMovie;
150
- typedef struct _PopplerActionRendition PopplerActionRendition;
151
- typedef struct _PopplerActionOCGState PopplerActionOCGState;
152
- typedef struct _PopplerActionJavascript PopplerActionJavascript;
153
- typedef struct _PopplerActionResetForm PopplerActionResetForm;
154
-
155
- /**
156
- * PopplerDest:
157
- * @type: type of destination
158
- * @page_num: page number
159
- * @left: left coordinate
160
- * @bottom: bottom coordinate
161
- * @right: right coordinate
162
- * @top: top coordinate
163
- * @zoom: scale factor
164
- * @named_dest: name of the destination (#POPPLER_DEST_NAMED only)
165
- * @change_left: whether left coordinate should be changed
166
- * @change_top: whether top coordinate should be changed
167
- * @change_zoom: whether scale factor should be changed
168
- *
169
- * Data structure for holding a destination
170
- *
171
- * Note that @named_dest is the string representation of the named
172
- * destination. This is the right form to pass to poppler functions,
173
- * e.g. poppler_document_find_dest(), but to get the destination as
174
- * it appears in the PDF itself, you need to convert it to a bytestring
175
- * with poppler_named_dest_to_bytestring() first.
176
- * Also note that @named_dest does not have a defined encoding and
177
- * is not in a form suitable to be displayed to the user.
178
- */
179
- struct _PopplerDest
180
- {
181
- PopplerDestType type;
182
-
183
- int page_num;
184
- double left;
185
- double bottom;
186
- double right;
187
- double top;
188
- double zoom;
189
- gchar *named_dest;
190
- guint change_left : 1;
191
- guint change_top : 1;
192
- guint change_zoom : 1;
193
- };
194
-
195
- /**
196
- * PopplerActionLayer:
197
- * @action: a #PopplerActionLayerAction
198
- * @layers: (element-type PopplerLayer): list of #PopplerLayer<!-- -->s
199
- *
200
- * Action to perform over a list of layers
201
- */
202
- struct _PopplerActionLayer
203
- {
204
- PopplerActionLayerAction action;
205
- GList *layers;
206
- };
207
-
208
- /**
209
- * PopplerActionAny:
210
- * @type: action type
211
- * @title: action title
212
- *
213
- * Fields common to all #PopplerAction<!-- -->s
214
- */
215
- struct _PopplerActionAny
216
- {
217
- PopplerActionType type;
218
- gchar *title;
219
- };
220
-
221
- /**
222
- * PopplerActionGotoDest:
223
- * @type: action type (%POPPLER_ACTION_GOTO_DEST)
224
- * @title: action title
225
- * @dest: destination
226
- *
227
- * Go to destination
228
- */
229
- struct _PopplerActionGotoDest
230
- {
231
- PopplerActionType type;
232
- gchar *title;
233
-
234
- PopplerDest *dest;
235
- };
236
-
237
- /**
238
- * PopplerActionGotoRemote:
239
- * @type: action type (%POPPLER_ACTION_GOTO_REMOTE)
240
- * @title: action title
241
- * @file_name: file name
242
- * @dest: destination
243
- *
244
- * Go to destination in another document
245
- */
246
- struct _PopplerActionGotoRemote
247
- {
248
- PopplerActionType type;
249
- gchar *title;
250
-
251
- gchar *file_name;
252
- PopplerDest *dest;
253
- };
254
-
255
- /**
256
- * PopplerActionLaunch:
257
- * @type: action type (%POPPLER_ACTION_LAUNCH)
258
- * @title: action title
259
- * @file_name: file name
260
- * @params: parameters
261
- *
262
- * Launch app (or open document)
263
- */
264
- struct _PopplerActionLaunch
265
- {
266
- PopplerActionType type;
267
- gchar *title;
268
-
269
- gchar *file_name;
270
- gchar *params;
271
- };
272
-
273
- /**
274
- * PopplerActionUri:
275
- * @type: action type (%POPPLER_ACTION_URI)
276
- * @title: action title
277
- * @uri: URI
278
- *
279
- * URI
280
- */
281
- struct _PopplerActionUri
282
- {
283
- PopplerActionType type;
284
- gchar *title;
285
-
286
- char *uri;
287
- };
288
-
289
- /**
290
- * PopplerActionNamed:
291
- * @type: action type (%POPPLER_ACTION_NAMED)
292
- * @title: action title
293
- * @named_dest: named destination
294
- *
295
- * Predefined action
296
- */
297
- struct _PopplerActionNamed
298
- {
299
- PopplerActionType type;
300
- gchar *title;
301
-
302
- gchar *named_dest;
303
- };
304
-
305
- /**
306
- * PopplerActionMovie:
307
- * @type: action type (%POPPLER_ACTION_MOVIE)
308
- * @title: action title
309
- * @operation: operation
310
- * @movie: movie
311
- *
312
- * Play movies.
313
- *
314
- * Since: 0.14
315
- */
316
- struct _PopplerActionMovie
317
- {
318
- PopplerActionType type;
319
- gchar *title;
320
-
321
- PopplerActionMovieOperation operation;
322
- PopplerMovie *movie;
323
- };
324
-
325
- /**
326
- * PopplerActionRendition:
327
- * @type: action type (%POPPLER_ACTION_RENDITION)
328
- * @title: action title
329
- * @op: operation
330
- * @media: media
331
- *
332
- * Play multimedia content.
333
- *
334
- * Since: 0.14
335
- */
336
- struct _PopplerActionRendition
337
- {
338
- PopplerActionType type;
339
- gchar *title;
340
-
341
- gint op;
342
- PopplerMedia *media;
343
- };
344
-
345
- /**
346
- * PopplerActionOCGState:
347
- * @type: action type (%POPPLER_ACTION_OCG_STATE)
348
- * @title: action title
349
- * @state_list: (element-type PopplerActionLayer): list of #PopplerActionLayer<!-- -->s
350
- *
351
- * State of layer.
352
- *
353
- * Since: 0.14
354
- */
355
- struct _PopplerActionOCGState
356
- {
357
- PopplerActionType type;
358
- gchar *title;
359
-
360
- GList *state_list;
361
- };
362
-
363
- /**
364
- * PopplerActionJavascript:
365
- * @type: action type (%POPPLER_ACTION_JAVASCRIPT)
366
- * @title: action title
367
- * @script: javascript
368
- *
369
- * Javascript.
370
- *
371
- * Since: 0.18
372
- */
373
- struct _PopplerActionJavascript
374
- {
375
- PopplerActionType type;
376
- gchar *title;
377
-
378
- gchar *script;
379
- };
380
-
381
- /**
382
- * PopplerActionResetForm:
383
- * @type: action type (%POPPLER_ACTION_RESET_FORM)
384
- * @title: action title
385
- * @fields: (element-type utf8) (nullable): list of field names to
386
- * reset / retain
387
- * @exclude: whether to reset all but the listed fields
388
- *
389
- * Resets some or all fields within a PDF form.
390
- *
391
- * The default behavior resets only the list of @fields, but setting
392
- * @exclude to %TRUE will cause the action to reset all fields but those
393
- * listed. Providing an empty list of fields resets the entire form.
394
- *
395
- * Since: 0.90
396
- */
397
- struct _PopplerActionResetForm
398
- {
399
- PopplerActionType type;
400
- gchar *title;
401
-
402
- GList *fields;
403
- gboolean exclude;
404
- };
405
-
406
- /**
407
- * PopplerAction:
408
- *
409
- * A generic wrapper for actions that exposes only #PopplerActionType.
410
- */
411
- union _PopplerAction {
412
- PopplerActionType type;
413
- PopplerActionAny any;
414
- PopplerActionGotoDest goto_dest;
415
- PopplerActionGotoRemote goto_remote;
416
- PopplerActionLaunch launch;
417
- PopplerActionUri uri;
418
- PopplerActionNamed named;
419
- PopplerActionMovie movie;
420
- PopplerActionRendition rendition;
421
- PopplerActionOCGState ocg_state;
422
- PopplerActionJavascript javascript;
423
- PopplerActionResetForm reset_form;
424
- };
425
-
426
- #define POPPLER_TYPE_ACTION (poppler_action_get_type())
427
- #define POPPLER_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), POPPLER_TYPE_ACTION, PopplerAction))
428
-
429
- POPPLER_PUBLIC
430
- GType poppler_action_get_type(void) G_GNUC_CONST;
431
-
432
- POPPLER_PUBLIC
433
- void poppler_action_free(PopplerAction *action);
434
- POPPLER_PUBLIC
435
- PopplerAction *poppler_action_copy(PopplerAction *action);
436
-
437
- #define POPPLER_TYPE_DEST (poppler_dest_get_type())
438
- POPPLER_PUBLIC
439
- GType poppler_dest_get_type(void) G_GNUC_CONST;
440
-
441
- POPPLER_PUBLIC
442
- void poppler_dest_free(PopplerDest *dest);
443
- POPPLER_PUBLIC
444
- PopplerDest *poppler_dest_copy(PopplerDest *dest);
445
-
446
- POPPLER_PUBLIC
447
- char *poppler_named_dest_from_bytestring(const guint8 *data, gsize length);
448
-
449
- POPPLER_PUBLIC
450
- guint8 *poppler_named_dest_to_bytestring(const char *name, gsize *length);
451
-
452
- G_END_DECLS
453
-
454
- #endif /* __POPPLER_GLIB_H__ */