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,44 +0,0 @@
1
- //========================================================================
2
- //
3
- // DateInfo.h
4
- //
5
- // Copyright (C) 2008, 2018, 2019 Albert Astals Cid <aacid@kde.org>
6
- // Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
7
- // Copyright (C) 2015 André Guerreiro <aguerreiro1985@gmail.com>
8
- // Copyright (C) 2015 André Esser <bepandre@hotmail.com>
9
- // Copyright (C) 2016, 2021 Adrian Johnson <ajohnson@redneon.com>
10
- //
11
- // To see a description of the changes please see the Changelog file that
12
- // came with your tarball or type make ChangeLog if you are building from git
13
- //
14
- //========================================================================
15
-
16
- //========================================================================
17
- //
18
- // Based on code from pdfinfo.cc
19
- //
20
- // Copyright 1998-2003 Glyph & Cog, LLC
21
- //
22
- //========================================================================
23
-
24
- #ifndef DATE_INFO_H
25
- #define DATE_INFO_H
26
-
27
- #include "goo/GooString.h"
28
- #include "poppler_private_export.h"
29
- #include <ctime>
30
-
31
- bool POPPLER_PRIVATE_EXPORT parseDateString(const GooString *date, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute);
32
-
33
- /* Converts the time_t into a PDF Date format string.
34
- * If timeA is NULL, current time is used.
35
- * Returns new GooString. Free with delete.
36
- */
37
- GooString POPPLER_PRIVATE_EXPORT *timeToDateString(const time_t *timeA);
38
-
39
- /* Convert PDF date string to time.
40
- * Returns -1 if conversion fails.
41
- */
42
- time_t POPPLER_PRIVATE_EXPORT dateStringToTime(const GooString *dateString);
43
-
44
- #endif
@@ -1,147 +0,0 @@
1
- //========================================================================
2
- //
3
- // Decrypt.h
4
- //
5
- // Copyright 1996-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) 2008 Julien Rebetez <julien@fhtagn.net>
17
- // Copyright (C) 2009 David Benjamin <davidben@mit.edu>
18
- // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
19
- // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
20
- // Copyright (C) 2013, 2018, 2019, 2021 Albert Astals Cid <aacid@kde.org>
21
- // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
22
- //
23
- // To see a description of the changes please see the Changelog file that
24
- // came with your tarball or type make ChangeLog if you are building from git
25
- //
26
- //========================================================================
27
-
28
- #ifndef DECRYPT_H
29
- #define DECRYPT_H
30
-
31
- #include "goo/GooString.h"
32
- #include "Object.h"
33
- #include "Stream.h"
34
-
35
- //------------------------------------------------------------------------
36
- // Decrypt
37
- //------------------------------------------------------------------------
38
-
39
- class Decrypt
40
- {
41
- public:
42
- // Generate a file key. The <fileKey> buffer must have space for at
43
- // least 16 bytes. Checks <ownerPassword> and then <userPassword>
44
- // and returns true if either is correct. Sets <ownerPasswordOk> if
45
- // the owner password was correct. Either or both of the passwords
46
- // may be NULL, which is treated as an empty string.
47
- static bool makeFileKey(int encVersion, int encRevision, int keyLength, const GooString *ownerKey, const GooString *userKey, const GooString *ownerEnc, const GooString *userEnc, int permissions, const GooString *fileID,
48
- const GooString *ownerPassword, const GooString *userPassword, unsigned char *fileKey, bool encryptMetadata, bool *ownerPasswordOk);
49
-
50
- private:
51
- static bool makeFileKey2(int encVersion, int encRevision, int keyLength, const GooString *ownerKey, const GooString *userKey, int permissions, const GooString *fileID, const GooString *userPassword, unsigned char *fileKey,
52
- bool encryptMetadata);
53
- };
54
-
55
- //------------------------------------------------------------------------
56
- // Helper classes
57
- //------------------------------------------------------------------------
58
-
59
- /* DecryptRC4State, DecryptAESState, DecryptAES256State are named like this for
60
- * historical reasons, but they're used for encryption too.
61
- * In case of decryption, the cbc field in AES and AES-256 contains the previous
62
- * input block or the CBC initialization vector (IV) if the stream has just been
63
- * reset). In case of encryption, it always contains the IV, whereas the
64
- * previous output is kept in buf. The paddingReached field is only used in
65
- * case of encryption. */
66
- struct DecryptRC4State
67
- {
68
- unsigned char state[256];
69
- unsigned char x, y;
70
- };
71
-
72
- struct DecryptAESState
73
- {
74
- unsigned int w[44];
75
- unsigned char state[16];
76
- unsigned char cbc[16];
77
- unsigned char buf[16];
78
- bool paddingReached; // encryption only
79
- int bufIdx;
80
- };
81
-
82
- struct DecryptAES256State
83
- {
84
- unsigned int w[60];
85
- unsigned char state[16];
86
- unsigned char cbc[16];
87
- unsigned char buf[16];
88
- bool paddingReached; // encryption only
89
- int bufIdx;
90
- };
91
-
92
- class BaseCryptStream : public FilterStream
93
- {
94
- public:
95
- BaseCryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, int keyLength, Ref ref);
96
- ~BaseCryptStream() override;
97
- StreamKind getKind() const override { return strCrypt; }
98
- void reset() override;
99
- int getChar() override;
100
- int lookChar() override = 0;
101
- Goffset getPos() override;
102
- bool isBinary(bool last) const override;
103
- Stream *getUndecodedStream() override { return this; }
104
- void setAutoDelete(bool val);
105
-
106
- protected:
107
- CryptAlgorithm algo;
108
- int objKeyLength;
109
- unsigned char objKey[32];
110
- Goffset charactersRead; // so that getPos() can be correct
111
- int nextCharBuff; // EOF means not read yet
112
- bool autoDelete;
113
-
114
- union {
115
- DecryptRC4State rc4;
116
- DecryptAESState aes;
117
- DecryptAES256State aes256;
118
- } state;
119
- };
120
-
121
- //------------------------------------------------------------------------
122
- // EncryptStream / DecryptStream
123
- //------------------------------------------------------------------------
124
-
125
- class EncryptStream : public BaseCryptStream
126
- {
127
- public:
128
- EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, int keyLength, Ref ref);
129
- ~EncryptStream() override;
130
- void reset() override;
131
- int lookChar() override;
132
- };
133
-
134
- class DecryptStream : public BaseCryptStream
135
- {
136
- public:
137
- DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, int keyLength, Ref ref);
138
- ~DecryptStream() override;
139
- void reset() override;
140
- int lookChar() override;
141
- };
142
-
143
- //------------------------------------------------------------------------
144
-
145
- extern void md5(const unsigned char *msg, int msgLen, unsigned char *digest);
146
-
147
- #endif
@@ -1,126 +0,0 @@
1
- //========================================================================
2
- //
3
- // Dict.h
4
- //
5
- // Copyright 1996-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) 2005 Kristian Høgsberg <krh@redhat.com>
17
- // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
18
- // Copyright (C) 2007-2008 Julien Rebetez <julienr@svn.gnome.org>
19
- // Copyright (C) 2010, 2017-2021 Albert Astals Cid <aacid@kde.org>
20
- // Copyright (C) 2010 Paweł Wiejacha <pawel.wiejacha@gmail.com>
21
- // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
22
- // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
23
- // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
24
- //
25
- // To see a description of the changes please see the Changelog file that
26
- // came with your tarball or type make ChangeLog if you are building from git
27
- //
28
- //========================================================================
29
-
30
- #ifndef DICT_H
31
- #define DICT_H
32
-
33
- #include <atomic>
34
- #include <mutex>
35
- #include <string>
36
- #include <vector>
37
- #include <utility>
38
-
39
- #include "poppler-config.h"
40
- #include "poppler_private_export.h"
41
- #include "Object.h"
42
-
43
- //------------------------------------------------------------------------
44
- // Dict
45
- //------------------------------------------------------------------------
46
-
47
- class POPPLER_PRIVATE_EXPORT Dict
48
- {
49
- public:
50
- // Constructor.
51
- explicit Dict(XRef *xrefA);
52
- explicit Dict(const Dict *dictA);
53
- Dict *copy(XRef *xrefA) const;
54
-
55
- Dict *deepCopy() const;
56
-
57
- Dict(const Dict &) = delete;
58
- Dict &operator=(const Dict &) = delete;
59
-
60
- // Get number of entries.
61
- int getLength() const { return static_cast<int>(entries.size()); }
62
-
63
- // Add an entry. (Copies key into Dict.)
64
- // val becomes a dead object after the call
65
- void add(const char *key, Object &&val);
66
-
67
- // Add an entry. (Takes ownership of key.)
68
- void add(char *key, Object &&val) = delete;
69
-
70
- // Update the value of an existing entry, otherwise create it
71
- // val becomes a dead object after the call
72
- void set(const char *key, Object &&val);
73
- // Remove an entry. This invalidate indexes
74
- void remove(const char *key);
75
-
76
- // Check if dictionary is of specified type.
77
- bool is(const char *type) const;
78
-
79
- // Look up an entry and return the value. Returns a null object
80
- // if <key> is not in the dictionary.
81
- Object lookup(const char *key, int recursion = 0) const;
82
- // Same as above but if the returned object is a fetched Ref returns such Ref in returnRef, otherwise returnRef is Ref::INVALID()
83
- Object lookup(const char *key, Ref *returnRef, int recursion = 0) const;
84
- // Look up an entry and return the value. Returns a null object
85
- // if <key> is not in the dictionary or if it is a ref to a non encrypted object in a partially encrypted document
86
- Object lookupEnsureEncryptedIfNeeded(const char *key) const;
87
- const Object &lookupNF(const char *key) const;
88
- bool lookupInt(const char *key, const char *alt_key, int *value) const;
89
-
90
- // Iterative accessors.
91
- const char *getKey(int i) const { return entries[i].first.c_str(); }
92
- Object getVal(int i) const { return entries[i].second.fetch(xref); }
93
- // Same as above but if the returned object is a fetched Ref returns such Ref in returnRef, otherwise returnRef is Ref::INVALID()
94
- Object getVal(int i, Ref *returnRef) const;
95
- const Object &getValNF(int i) const { return entries[i].second; }
96
-
97
- // Set the xref pointer. This is only used in one special case: the
98
- // trailer dictionary, which is read before the xref table is
99
- // parsed.
100
- void setXRef(XRef *xrefA) { xref = xrefA; }
101
-
102
- XRef *getXRef() const { return xref; }
103
-
104
- bool hasKey(const char *key) const;
105
-
106
- private:
107
- friend class Object; // for incRef/decRef
108
-
109
- // Reference counting.
110
- int incRef() { return ++ref; }
111
- int decRef() { return --ref; }
112
-
113
- using DictEntry = std::pair<std::string, Object>;
114
- struct CmpDictEntry;
115
-
116
- XRef *xref; // the xref table for this PDF file
117
- std::vector<DictEntry> entries;
118
- std::atomic_int ref; // reference count
119
- std::atomic_bool sorted;
120
- mutable std::recursive_mutex mutex;
121
-
122
- const DictEntry *find(const char *key) const;
123
- DictEntry *find(const char *key);
124
- };
125
-
126
- #endif
@@ -1,59 +0,0 @@
1
- //========================================================================
2
- //
3
- // Error.h
4
- //
5
- // Copyright 1996-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) 2005, 2007 Jeff Muizelaar <jeff@infidigm.net>
17
- // Copyright (C) 2005, 2018 Albert Astals Cid <aacid@kde.org>
18
- // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
19
- // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
20
- // Copyright (C) 2014 Fabio D'Urso <fabiodurso@hotmail.it>
21
- // Copyright (C) 2020 Adam Reichold <adam.reichold@t-online.de>
22
- //
23
- // To see a description of the changes please see the Changelog file that
24
- // came with your tarball or type make ChangeLog if you are building from git
25
- //
26
- //========================================================================
27
-
28
- #ifndef ERROR_H
29
- #define ERROR_H
30
-
31
- #include <cstdarg>
32
- #include "poppler-config.h"
33
- #include "poppler_private_export.h"
34
- #include "goo/gfile.h"
35
- #include "goo/GooString.h"
36
-
37
- enum ErrorCategory
38
- {
39
- errSyntaxWarning, // PDF syntax error which can be worked around;
40
- // output will probably be correct
41
- errSyntaxError, // PDF syntax error which can be worked around;
42
- // output will probably be incorrect
43
- errConfig, // error in Xpdf config info (xpdfrc file, etc.)
44
- errCommandLine, // error in user-supplied parameters, action not
45
- // allowed, etc. (only used by command-line tools)
46
- errIO, // error in file I/O
47
- errNotAllowed, // action not allowed by PDF permission bits
48
- errUnimplemented, // unimplemented PDF feature - display will be
49
- // incorrect
50
- errInternal // internal error - malfunction within the Xpdf code
51
- };
52
-
53
- using ErrorCallback = void (*)(ErrorCategory category, Goffset pos, const char *msg);
54
-
55
- extern void POPPLER_PRIVATE_EXPORT setErrorCallback(ErrorCallback cbk);
56
-
57
- extern void CDECL POPPLER_PRIVATE_EXPORT error(ErrorCategory category, Goffset pos, const char *msg, ...) GOOSTRING_FORMAT;
58
-
59
- #endif
@@ -1,54 +0,0 @@
1
- //========================================================================
2
- //
3
- // ErrorCodes.h
4
- //
5
- // Copyright 2002-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) 2017 Albert Astals Cid <aacid@kde.org>
17
- //
18
- // To see a description of the changes please see the Changelog file that
19
- // came with your tarball or type make ChangeLog if you are building from git
20
- //
21
- //========================================================================
22
-
23
- #ifndef ERRORCODES_H
24
- #define ERRORCODES_H
25
-
26
- #define errNone 0 // no error
27
-
28
- #define errOpenFile 1 // couldn't open the PDF file
29
-
30
- #define errBadCatalog 2 // couldn't read the page catalog
31
-
32
- #define errDamaged \
33
- 3 // PDF file was damaged and couldn't be
34
- // repaired
35
-
36
- #define errEncrypted \
37
- 4 // file was encrypted and password was
38
- // incorrect or not supplied
39
-
40
- #define errHighlightFile 5 // nonexistent or invalid highlight file
41
-
42
- #define errBadPrinter 6 // invalid printer
43
-
44
- #define errPrinting 7 // error during printing
45
-
46
- #define errPermission 8 // PDF file doesn't allow that operation
47
-
48
- #define errBadPageNum 9 // invalid page number
49
-
50
- #define errFileIO 10 // file I/O error
51
-
52
- #define errFileChangedSinceOpen 11 // file has changed since opening and save can't be done
53
-
54
- #endif
@@ -1,36 +0,0 @@
1
- //========================================================================
2
- //
3
- // FileDescriptorPDFDocBuilder.h
4
- //
5
- // This file is licensed under the GPLv2 or later
6
- //
7
- // Copyright 2010 Hib Eris <hib@hiberis.nl>
8
- // Copyright 2010, 2018, 2022 Albert Astals Cid <aacid@kde.org>
9
- // Copyright 2021 Oliver Sander <oliver.sander@tu-dresden.de>
10
- // Copyright 2021 Christian Persch <chpe@src.gnome.org>
11
- //
12
- //========================================================================
13
-
14
- #ifndef FDPDFDOCBUILDER_H
15
- #define FDPDFDOCBUILDER_H
16
-
17
- #include "PDFDocBuilder.h"
18
-
19
- //------------------------------------------------------------------------
20
- // FileDescriptorPDFDocBuilder
21
- //
22
- // The FileDescriptorPDFDocBuilder implements a PDFDocBuilder that read from a file descriptor.
23
- //------------------------------------------------------------------------
24
-
25
- class FileDescriptorPDFDocBuilder : public PDFDocBuilder
26
- {
27
-
28
- public:
29
- std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override;
30
- bool supports(const GooString &uri) override;
31
-
32
- private:
33
- int parseFdFromUri(const GooString &uri);
34
- };
35
-
36
- #endif /* FDPDFDOCBUILDER_H */
@@ -1,34 +0,0 @@
1
- //========================================================================
2
- //
3
- // FILECacheLoader.h
4
- //
5
- // This file is licensed under the GPLv2 or later
6
- //
7
- // Copyright 2010 Hib Eris <hib@hiberis.nl>
8
- // Copyright 2010, 2022 Albert Astals Cid <aacid@kde.org>
9
- // Copyright 2021 Christian Persch <chpe@src.gnome.org>
10
- //
11
- //========================================================================
12
-
13
- #ifndef FILECACHELOADER_H
14
- #define FILECACHELOADER_H
15
-
16
- #include "CachedFile.h"
17
-
18
- #include <cstdio>
19
-
20
- class POPPLER_PRIVATE_EXPORT FILECacheLoader : public CachedFileLoader
21
- {
22
- FILE *file = stdin;
23
-
24
- public:
25
- FILECacheLoader() = default;
26
- ~FILECacheLoader() override;
27
-
28
- explicit FILECacheLoader(FILE *fileA) : file(fileA) { }
29
-
30
- size_t init(CachedFile *cachedFile) override;
31
- int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer) override;
32
- };
33
-
34
- #endif
@@ -1,85 +0,0 @@
1
- //========================================================================
2
- //
3
- // FileSpec.h
4
- //
5
- // All changes made under the Poppler project to this file are licensed
6
- // under GPL version 2 or later
7
- //
8
- // Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
9
- // Copyright (C) 2017-2019, 2021 Albert Astals Cid <aacid@kde.org>
10
- //
11
- // To see a description of the changes please see the Changelog file that
12
- // came with your tarball or type make ChangeLog if you are building from git
13
- //
14
- //========================================================================
15
-
16
- #ifndef FILE_SPEC_H
17
- #define FILE_SPEC_H
18
-
19
- #include "Object.h"
20
- #include "poppler_private_export.h"
21
-
22
- class POPPLER_PRIVATE_EXPORT EmbFile
23
- {
24
- public:
25
- explicit EmbFile(Object &&efStream);
26
- ~EmbFile();
27
-
28
- EmbFile(const EmbFile &) = delete;
29
- EmbFile &operator=(const EmbFile &) = delete;
30
-
31
- int size() const { return m_size; }
32
- const GooString *modDate() const { return m_modDate; }
33
- const GooString *createDate() const { return m_createDate; }
34
- const GooString *checksum() const { return m_checksum; }
35
- const GooString *mimeType() const { return m_mimetype; }
36
- Object *streamObject() { return &m_objStr; }
37
- Stream *stream() { return isOk() ? m_objStr.getStream() : nullptr; }
38
- bool isOk() const { return m_objStr.isStream(); }
39
- bool save(const char *path);
40
-
41
- private:
42
- bool save2(FILE *f);
43
-
44
- int m_size;
45
- GooString *m_createDate;
46
- GooString *m_modDate;
47
- GooString *m_checksum;
48
- GooString *m_mimetype;
49
- Object m_objStr;
50
- };
51
-
52
- class POPPLER_PRIVATE_EXPORT FileSpec
53
- {
54
- public:
55
- explicit FileSpec(const Object *fileSpec);
56
- ~FileSpec();
57
-
58
- FileSpec(const FileSpec &) = delete;
59
- FileSpec &operator=(const FileSpec &) = delete;
60
-
61
- bool isOk() const { return ok; }
62
-
63
- const GooString *getFileName() const { return fileName; }
64
- GooString *getFileNameForPlatform();
65
- const GooString *getDescription() const { return desc; }
66
- EmbFile *getEmbeddedFile();
67
-
68
- static Object newFileSpecObject(XRef *xref, GooFile *file, const std::string &fileName);
69
-
70
- private:
71
- bool ok;
72
-
73
- Object fileSpec;
74
-
75
- GooString *fileName; // F, UF, DOS, Mac, Unix
76
- GooString *platformFileName;
77
- Object fileStream; // Ref to F entry in UF
78
- EmbFile *embFile;
79
- GooString *desc; // Desc
80
- };
81
-
82
- Object getFileSpecName(const Object *fileSpec);
83
- Object POPPLER_PRIVATE_EXPORT getFileSpecNameForPlatform(const Object *fileSpec);
84
-
85
- #endif /* FILE_SPEC_H */
@@ -1,20 +0,0 @@
1
- //========================================================================
2
- //
3
- // FontEncodingTables.h
4
- //
5
- // Copyright 2001-2003 Glyph & Cog, LLC
6
- //
7
- //========================================================================
8
-
9
- #ifndef FONTENCODINGTABLES_H
10
- #define FONTENCODINGTABLES_H
11
-
12
- extern const char *macRomanEncoding[];
13
- extern const char *macExpertEncoding[];
14
- extern const char *winAnsiEncoding[];
15
- extern const char *standardEncoding[];
16
- extern const char *expertEncoding[];
17
- extern const char *symbolEncoding[];
18
- extern const char *zapfDingbatsEncoding[];
19
-
20
- #endif