node-poppler 5.1.4 → 5.1.5

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 (172) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/package.json +10 -10
  3. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Annot.h +0 -1783
  4. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/AnnotStampImageHelper.h +0 -68
  5. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Array.h +0 -92
  6. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/BBoxOutputDev.h +0 -54
  7. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CMap.h +0 -128
  8. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CachedFile.h +0 -149
  9. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoFontEngine.h +0 -122
  10. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoOutputDev.h +0 -468
  11. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoRescaleBox.h +0 -60
  12. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Catalog.h +0 -318
  13. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CertificateInfo.h +0 -129
  14. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharCodeToUnicode.h +0 -143
  15. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharTypes.h +0 -24
  16. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlCachedFile.h +0 -37
  17. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlPDFDocBuilder.h +0 -32
  18. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/DateInfo.h +0 -44
  19. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Decrypt.h +0 -147
  20. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Dict.h +0 -126
  21. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Error.h +0 -59
  22. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ErrorCodes.h +0 -54
  23. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FDPDFDocBuilder.h +0 -36
  24. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FILECacheLoader.h +0 -34
  25. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FileSpec.h +0 -85
  26. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontEncodingTables.h +0 -20
  27. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontInfo.h +0 -109
  28. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Form.h +0 -734
  29. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Function.h +0 -251
  30. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Gfx.h +0 -373
  31. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxFont.h +0 -466
  32. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState.h +0 -1759
  33. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState_helpers.h +0 -90
  34. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GlobalParams.h +0 -221
  35. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Hints.h +0 -91
  36. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JArithmeticDecoder.h +0 -131
  37. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JBIG2Stream.h +0 -130
  38. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JPEG2000Stream.h +0 -54
  39. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JSInfo.h +0 -65
  40. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Lexer.h +0 -113
  41. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Linearization.h +0 -43
  42. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Link.h +0 -566
  43. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/LocalPDFDocBuilder.h +0 -32
  44. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/MarkedContentOutputDev.h +0 -132
  45. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Movie.h +0 -123
  46. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToCharCode.h +0 -52
  47. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToUnicodeTable.h +0 -4300
  48. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Object.h +0 -678
  49. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OptionalContent.h +0 -117
  50. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Outline.h +0 -122
  51. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OutputDev.h +0 -379
  52. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDoc.h +0 -419
  53. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocBuilder.h +0 -47
  54. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocEncoding.h +0 -43
  55. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocFactory.h +0 -58
  56. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSOutputDev.h +0 -549
  57. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSTokenizer.h +0 -47
  58. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Page.h +0 -273
  59. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PageTransition.h +0 -105
  60. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Parser.h +0 -76
  61. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PopplerCache.h +0 -65
  62. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PreScanOutputDev.h +0 -148
  63. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ProfileData.h +0 -35
  64. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Rendition.h +0 -164
  65. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SecurityHandler.h +0 -131
  66. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Sound.h +0 -82
  67. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SplashOutputDev.h +0 -413
  68. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream-CCITT.h +0 -334
  69. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream.h +0 -1504
  70. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructElement.h +0 -406
  71. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructTreeRoot.h +0 -89
  72. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/TextOutputDev.h +0 -918
  73. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UTF.h +0 -112
  74. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCClassTables.h +0 -983
  75. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCompTables.h +0 -328
  76. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeDecompTables.h +0 -7181
  77. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMap.h +0 -128
  78. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapFuncs.h +0 -35
  79. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapTables.h +0 -84
  80. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeTypeTable.h +0 -49
  81. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ViewerPreferences.h +0 -87
  82. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/XRef.h +0 -325
  83. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-destination.h +0 -69
  84. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-document.h +0 -135
  85. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-embedded-file.h +0 -55
  86. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font-private.h +0 -68
  87. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font.h +0 -95
  88. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-global.h +0 -132
  89. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-image.h +0 -74
  90. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-renderer.h +0 -77
  91. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-transition.h +0 -85
  92. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page.h +0 -225
  93. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-rectangle.h +0 -66
  94. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-toc.h +0 -72
  95. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-version.h +0 -39
  96. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler_cpp_export.h +0 -42
  97. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiBase.h +0 -66
  98. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiEncodings.h +0 -43
  99. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiIdentifier.h +0 -52
  100. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiTrueType.h +0 -190
  101. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1.h +0 -70
  102. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1C.h +0 -263
  103. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-action.h +0 -454
  104. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-annot.h +0 -333
  105. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-attachment.h +0 -123
  106. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-date.h +0 -32
  107. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-document.h +0 -541
  108. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-enums.h +0 -191
  109. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-features.h +0 -88
  110. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-form-field.h +0 -254
  111. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-layer.h +0 -50
  112. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-macros.h +0 -42
  113. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-media.h +0 -80
  114. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-movie.h +0 -81
  115. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-page.h +0 -424
  116. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-structure-element.h +0 -425
  117. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler.h +0 -259
  118. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooCheckedOps.h +0 -116
  119. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooLikely.h +0 -22
  120. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooString.h +0 -262
  121. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooTimer.h +0 -59
  122. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/ImgWriter.h +0 -39
  123. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/JpegWriter.h +0 -69
  124. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/PNGWriter.h +0 -68
  125. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/TiffWriter.h +0 -70
  126. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gdir.h +0 -96
  127. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gfile.h +0 -156
  128. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gmem.h +0 -201
  129. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/grandom.h +0 -21
  130. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gstrtod.h +0 -45
  131. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler-config.h +0 -155
  132. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler_private_export.h +0 -42
  133. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/Splash.h +0 -336
  134. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashBitmap.h +0 -127
  135. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashClip.h +0 -131
  136. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashErrorCodes.h +0 -50
  137. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFont.h +0 -71
  138. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontEngine.h +0 -72
  139. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontFile.h +0 -64
  140. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFont.h +0 -116
  141. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontEngine.h +0 -89
  142. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFile.h +0 -98
  143. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFileID.h +0 -40
  144. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashGlyphBitmap.h +0 -23
  145. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashMath.h +0 -215
  146. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPath.h +0 -138
  147. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPattern.h +0 -107
  148. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashScreen.h +0 -87
  149. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashState.h +0 -132
  150. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashTypes.h +0 -248
  151. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPath.h +0 -95
  152. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPathScanner.h +0 -136
  153. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-cpp.pc +0 -12
  154. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-glib.pc +0 -12
  155. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler.pc +0 -10
  156. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-cpp.lib +0 -0
  157. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-glib.lib +0 -0
  158. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler.lib +0 -0
  159. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfattach.1 +0 -60
  160. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfdetach.1 +0 -94
  161. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdffonts.1 +0 -128
  162. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfimages.1 +0 -265
  163. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfinfo.1 +0 -198
  164. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfseparate.1 +0 -60
  165. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftocairo.1 +0 -346
  166. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftohtml.1 +0 -118
  167. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftoppm.1 +0 -230
  168. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftops.1 +0 -267
  169. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftotext.1 +0 -157
  170. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfunite.1 +0 -43
  171. package/src/lib/win32/poppler-22.04.0/share/poppler/CMakeLists.txt +0 -309
  172. package/src/lib/win32/poppler-22.04.0/share/poppler/Makefile +0 -333
@@ -1,1783 +0,0 @@
1
- //========================================================================
2
- //
3
- // Annot.h
4
- //
5
- // Copyright 2000-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 Scott Turner <scotty1024@mac.com>
17
- // Copyright (C) 2007, 2008 Julien Rebetez <julienr@svn.gnome.org>
18
- // Copyright (C) 2007-2011, 2013, 2015, 2018 Carlos Garcia Campos <carlosgc@gnome.org>
19
- // Copyright (C) 2007, 2008 Iñigo Martínez <inigomartinez@gmail.com>
20
- // Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
21
- // Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
22
- // Copyright (C) 2008 Pino Toscano <pino@kde.org>
23
- // Copyright (C) 2008 Tomas Are Haavet <tomasare@gmail.com>
24
- // Copyright (C) 2009-2011, 2013, 2016-2022 Albert Astals Cid <aacid@kde.org>
25
- // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso@hotmail.it>
26
- // Copyright (C) 2012, 2015 Tobias Koenig <tokoe@kdab.com>
27
- // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
28
- // Copyright (C) 2013, 2017 Adrian Johnson <ajohnson@redneon.com>
29
- // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
30
- // Copyright (C) 2018 Dileep Sankhla <sankhla.dileep96@gmail.com>
31
- // Copyright (C) 2018-2020 Tobias Deiminger <haxtibal@posteo.de>
32
- // Copyright (C) 2018, 2020, 2022 Oliver Sander <oliver.sander@tu-dresden.de>
33
- // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
34
- // Copyright (C) 2019 Umang Malik <umang99m@gmail.com>
35
- // Copyright (C) 2019 João Netto <joaonetto901@gmail.com>
36
- // Copyright (C) 2020 Nelson Benítez León <nbenitezl@gmail.com>
37
- // Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
38
- // Copyright (C) 2020 Katarina Behrens <Katarina.Behrens@cib.de>
39
- // Copyright (C) 2020 Thorsten Behrens <Thorsten.Behrens@CIB.de>
40
- // Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>.
41
- // Copyright (C) 2021 Zachary Travis <ztravis@everlaw.com>
42
- // Copyright (C) 2021 Mahmoud Ahmed Khalil <mahmoudkhalil11@gmail.com>
43
- // Copyright (C) 2021 Georgiy Sgibnev <georgiy@sgibnev.com>. Work sponsored by lab50.net.
44
- // Copyright (C) 2022 Martin <martinbts@gmx.net>
45
- //
46
- // To see a description of the changes please see the Changelog file that
47
- // came with your tarball or type make ChangeLog if you are building from git
48
- //
49
- //========================================================================
50
-
51
- #ifndef ANNOT_H
52
- #define ANNOT_H
53
-
54
- #include <memory>
55
- #include <atomic>
56
- #include <mutex>
57
- #include <vector>
58
-
59
- #include "AnnotStampImageHelper.h"
60
- #include "Object.h"
61
- #include "poppler_private_export.h"
62
-
63
- class XRef;
64
- class Gfx;
65
- class CharCodeToUnicode;
66
- class GfxFont;
67
- class GfxResources;
68
- class Page;
69
- class PDFDoc;
70
- class Form;
71
- class FormWidget;
72
- class FormField;
73
- class FormFieldButton;
74
- class FormFieldText;
75
- class FormFieldChoice;
76
- class FormFieldSignature;
77
- class PDFRectangle;
78
- class Movie;
79
- class LinkAction;
80
- class Sound;
81
- class FileSpec;
82
-
83
- enum AnnotLineEndingStyle
84
- {
85
- annotLineEndingSquare, // Square
86
- annotLineEndingCircle, // Circle
87
- annotLineEndingDiamond, // Diamond
88
- annotLineEndingOpenArrow, // OpenArrow
89
- annotLineEndingClosedArrow, // ClosedArrow
90
- annotLineEndingNone, // None
91
- annotLineEndingButt, // Butt
92
- annotLineEndingROpenArrow, // ROpenArrow
93
- annotLineEndingRClosedArrow, // RClosedArrow
94
- annotLineEndingSlash // Slash
95
- };
96
-
97
- enum AnnotExternalDataType
98
- {
99
- annotExternalDataMarkupUnknown,
100
- annotExternalDataMarkup3D // Markup3D
101
- };
102
-
103
- enum class VariableTextQuadding
104
- {
105
- leftJustified,
106
- centered,
107
- rightJustified
108
- };
109
-
110
- //------------------------------------------------------------------------
111
- // AnnotCoord
112
- //------------------------------------------------------------------------
113
-
114
- class AnnotCoord
115
- {
116
- public:
117
- AnnotCoord() : x(0), y(0) { }
118
- AnnotCoord(double _x, double _y) : x(_x), y(_y) { }
119
-
120
- double getX() const { return x; }
121
- double getY() const { return y; }
122
-
123
- protected:
124
- double x, y;
125
- };
126
-
127
- //------------------------------------------------------------------------
128
- // AnnotPath
129
- //------------------------------------------------------------------------
130
-
131
- class POPPLER_PRIVATE_EXPORT AnnotPath
132
- {
133
- public:
134
- AnnotPath();
135
- explicit AnnotPath(Array *array);
136
- explicit AnnotPath(std::vector<AnnotCoord> &&coords);
137
- ~AnnotPath();
138
-
139
- AnnotPath(const AnnotPath &) = delete;
140
- AnnotPath &operator=(const AnnotPath &other) = delete;
141
-
142
- double getX(int coord) const;
143
- double getY(int coord) const;
144
- AnnotCoord *getCoord(int coord);
145
- int getCoordsLength() const { return coords.size(); }
146
-
147
- protected:
148
- std::vector<AnnotCoord> coords;
149
-
150
- void parsePathArray(Array *array);
151
- };
152
-
153
- //------------------------------------------------------------------------
154
- // AnnotCalloutLine
155
- //------------------------------------------------------------------------
156
-
157
- class POPPLER_PRIVATE_EXPORT AnnotCalloutLine
158
- {
159
- public:
160
- AnnotCalloutLine(double x1, double y1, double x2, double y2);
161
- virtual ~AnnotCalloutLine();
162
-
163
- AnnotCalloutLine(const AnnotCalloutLine &) = delete;
164
- AnnotCalloutLine &operator=(const AnnotCalloutLine &other) = delete;
165
-
166
- double getX1() const { return coord1.getX(); }
167
- double getY1() const { return coord1.getY(); }
168
- double getX2() const { return coord2.getX(); }
169
- double getY2() const { return coord2.getY(); }
170
-
171
- protected:
172
- AnnotCoord coord1, coord2;
173
- };
174
-
175
- //------------------------------------------------------------------------
176
- // AnnotCalloutMultiLine
177
- //------------------------------------------------------------------------
178
-
179
- class POPPLER_PRIVATE_EXPORT AnnotCalloutMultiLine : public AnnotCalloutLine
180
- {
181
- public:
182
- AnnotCalloutMultiLine(double x1, double y1, double x2, double y2, double x3, double y3);
183
- ~AnnotCalloutMultiLine() override;
184
-
185
- double getX3() const { return coord3.getX(); }
186
- double getY3() const { return coord3.getY(); }
187
-
188
- protected:
189
- AnnotCoord coord3;
190
- };
191
-
192
- //------------------------------------------------------------------------
193
- // AnnotBorderEffect
194
- //------------------------------------------------------------------------
195
-
196
- class AnnotBorderEffect
197
- {
198
- public:
199
- enum AnnotBorderEffectType
200
- {
201
- borderEffectNoEffect, // S
202
- borderEffectCloudy // C
203
- };
204
-
205
- explicit AnnotBorderEffect(Dict *dict);
206
-
207
- AnnotBorderEffectType getEffectType() const { return effectType; }
208
- double getIntensity() const { return intensity; }
209
-
210
- private:
211
- AnnotBorderEffectType effectType; // S (Default S)
212
- double intensity; // I (Default 0)
213
- };
214
-
215
- //------------------------------------------------------------------------
216
- // AnnotQuadrilateral
217
- //------------------------------------------------------------------------
218
-
219
- class POPPLER_PRIVATE_EXPORT AnnotQuadrilaterals
220
- {
221
- public:
222
- class POPPLER_PRIVATE_EXPORT AnnotQuadrilateral
223
- {
224
- public:
225
- AnnotQuadrilateral();
226
- AnnotQuadrilateral(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
227
-
228
- AnnotCoord coord1, coord2, coord3, coord4;
229
- };
230
-
231
- AnnotQuadrilaterals(Array *array, PDFRectangle *rect);
232
- AnnotQuadrilaterals(std::unique_ptr<AnnotQuadrilateral[]> &&quads, int quadsLength);
233
- ~AnnotQuadrilaterals();
234
-
235
- AnnotQuadrilaterals(const AnnotQuadrilaterals &) = delete;
236
- AnnotQuadrilaterals &operator=(const AnnotQuadrilaterals &other) = delete;
237
-
238
- double getX1(int quadrilateral);
239
- double getY1(int quadrilateral);
240
- double getX2(int quadrilateral);
241
- double getY2(int quadrilateral);
242
- double getX3(int quadrilateral);
243
- double getY3(int quadrilateral);
244
- double getX4(int quadrilateral);
245
- double getY4(int quadrilateral);
246
- int getQuadrilateralsLength() const { return quadrilateralsLength; }
247
-
248
- protected:
249
- std::unique_ptr<AnnotQuadrilateral[]> quadrilaterals;
250
- int quadrilateralsLength;
251
- };
252
-
253
- //------------------------------------------------------------------------
254
- // AnnotBorder
255
- //------------------------------------------------------------------------
256
-
257
- class AnnotBorder
258
- {
259
- public:
260
- enum AnnotBorderType
261
- {
262
- typeArray,
263
- typeBS
264
- };
265
-
266
- enum AnnotBorderStyle
267
- {
268
- borderSolid, // Solid
269
- borderDashed, // Dashed
270
- borderBeveled, // Beveled
271
- borderInset, // Inset
272
- borderUnderlined // Underlined
273
- };
274
-
275
- virtual ~AnnotBorder();
276
-
277
- AnnotBorder(const AnnotBorder &) = delete;
278
- AnnotBorder &operator=(const AnnotBorder &other) = delete;
279
-
280
- virtual void setWidth(double new_width) { width = new_width; }
281
-
282
- virtual AnnotBorderType getType() const = 0;
283
- virtual double getWidth() const { return width; }
284
- virtual int getDashLength() const { return dashLength; }
285
- virtual double *getDash() const { return dash; }
286
- virtual AnnotBorderStyle getStyle() const { return style; }
287
-
288
- virtual Object writeToObject(XRef *xref) const = 0;
289
- virtual std::unique_ptr<AnnotBorder> copy() const = 0;
290
-
291
- protected:
292
- AnnotBorder();
293
-
294
- bool parseDashArray(Object *dashObj);
295
-
296
- AnnotBorderType type;
297
- double width;
298
- static const int DASH_LIMIT = 10; // implementation note 82 in Appendix H.
299
- int dashLength;
300
- double *dash;
301
- AnnotBorderStyle style;
302
- };
303
-
304
- //------------------------------------------------------------------------
305
- // AnnotBorderArray
306
- //------------------------------------------------------------------------
307
-
308
- class POPPLER_PRIVATE_EXPORT AnnotBorderArray : public AnnotBorder
309
- {
310
- public:
311
- AnnotBorderArray();
312
- explicit AnnotBorderArray(Array *array);
313
-
314
- void setHorizontalCorner(double hc) { horizontalCorner = hc; }
315
- void setVerticalCorner(double vc) { verticalCorner = vc; }
316
-
317
- double getHorizontalCorner() const { return horizontalCorner; }
318
- double getVerticalCorner() const { return verticalCorner; }
319
-
320
- std::unique_ptr<AnnotBorder> copy() const override;
321
-
322
- private:
323
- AnnotBorderType getType() const override { return typeArray; }
324
- Object writeToObject(XRef *xref) const override;
325
-
326
- double horizontalCorner; // (Default 0)
327
- double verticalCorner; // (Default 0)
328
- // double width; // (Default 1) (inherited from AnnotBorder)
329
- };
330
-
331
- //------------------------------------------------------------------------
332
- // AnnotBorderBS
333
- //------------------------------------------------------------------------
334
-
335
- class AnnotBorderBS : public AnnotBorder
336
- {
337
- public:
338
- AnnotBorderBS();
339
- explicit AnnotBorderBS(Dict *dict);
340
-
341
- private:
342
- AnnotBorderType getType() const override { return typeBS; }
343
- Object writeToObject(XRef *xref) const override;
344
-
345
- const char *getStyleName() const;
346
-
347
- std::unique_ptr<AnnotBorder> copy() const override;
348
-
349
- // double width; // W (Default 1) (inherited from AnnotBorder)
350
- // AnnotBorderStyle style; // S (Default S) (inherited from AnnotBorder)
351
- // double *dash; // D (Default [3]) (inherited from AnnotBorder)
352
- };
353
-
354
- //------------------------------------------------------------------------
355
- // AnnotColor
356
- //------------------------------------------------------------------------
357
-
358
- class POPPLER_PRIVATE_EXPORT AnnotColor
359
- {
360
- public:
361
- enum AnnotColorSpace
362
- {
363
- colorTransparent = 0,
364
- colorGray = 1,
365
- colorRGB = 3,
366
- colorCMYK = 4
367
- };
368
-
369
- AnnotColor();
370
- explicit AnnotColor(double gray);
371
- AnnotColor(double r, double g, double b);
372
- AnnotColor(double c, double m, double y, double k);
373
- explicit AnnotColor(Array *array, int adjust = 0);
374
-
375
- void adjustColor(int adjust);
376
-
377
- AnnotColorSpace getSpace() const { return (AnnotColorSpace)length; }
378
- const double *getValues() const { return values; }
379
-
380
- Object writeToObject(XRef *xref) const;
381
-
382
- private:
383
- double values[4];
384
- int length;
385
- };
386
-
387
- //------------------------------------------------------------------------
388
- // DefaultAppearance
389
- //------------------------------------------------------------------------
390
-
391
- class POPPLER_PRIVATE_EXPORT DefaultAppearance
392
- {
393
- public:
394
- DefaultAppearance(Object &&fontNameA, double fontPtSizeA, std::unique_ptr<AnnotColor> &&fontColorA);
395
- explicit DefaultAppearance(const GooString *da);
396
- void setFontName(Object &&fontNameA);
397
- const Object &getFontName() const { return fontName; }
398
- void setFontPtSize(double fontPtSizeA);
399
- double getFontPtSize() const { return fontPtSize; }
400
- void setFontColor(std::unique_ptr<AnnotColor> fontColorA);
401
- const AnnotColor *getFontColor() const { return fontColor.get(); }
402
- std::string toAppearanceString() const;
403
-
404
- DefaultAppearance(const DefaultAppearance &) = delete;
405
- DefaultAppearance &operator=(const DefaultAppearance &) = delete;
406
-
407
- private:
408
- Object fontName;
409
- double fontPtSize;
410
- std::unique_ptr<AnnotColor> fontColor;
411
- };
412
-
413
- //------------------------------------------------------------------------
414
- // AnnotIconFit
415
- //------------------------------------------------------------------------
416
-
417
- class AnnotIconFit
418
- {
419
- public:
420
- enum AnnotIconFitScaleWhen
421
- {
422
- scaleAlways, // A
423
- scaleBigger, // B
424
- scaleSmaller, // S
425
- scaleNever // N
426
- };
427
-
428
- enum AnnotIconFitScale
429
- {
430
- scaleAnamorphic, // A
431
- scaleProportional // P
432
- };
433
-
434
- explicit AnnotIconFit(Dict *dict);
435
-
436
- AnnotIconFitScaleWhen getScaleWhen() { return scaleWhen; }
437
- AnnotIconFitScale getScale() { return scale; }
438
- double getLeft() { return left; }
439
- double getBottom() { return bottom; }
440
- bool getFullyBounds() { return fullyBounds; }
441
-
442
- protected:
443
- AnnotIconFitScaleWhen scaleWhen; // SW (Default A)
444
- AnnotIconFitScale scale; // S (Default P)
445
- double left; // A (Default [0.5 0.5]
446
- double bottom; // Only if scale is P
447
- bool fullyBounds; // FB (Default false)
448
- };
449
-
450
- //------------------------------------------------------------------------
451
- // AnnotAppearance
452
- //------------------------------------------------------------------------
453
-
454
- class AnnotAppearance
455
- {
456
- public:
457
- enum AnnotAppearanceType
458
- {
459
- appearNormal,
460
- appearRollover,
461
- appearDown
462
- };
463
-
464
- AnnotAppearance(PDFDoc *docA, Object *dict);
465
- ~AnnotAppearance();
466
-
467
- // State is ignored if no subdictionary is present
468
- Object getAppearanceStream(AnnotAppearanceType type, const char *state);
469
-
470
- // Access keys in normal appearance subdictionary (N)
471
- std::unique_ptr<GooString> getStateKey(int i);
472
- int getNumStates();
473
-
474
- // Removes all associated streams in the xref table. Caller is required to
475
- // reset parent annotation's AP and AS after this call.
476
- void removeAllStreams();
477
-
478
- // Test if this AnnotAppearance references the specified stream
479
- bool referencesStream(Ref refToStream);
480
-
481
- private:
482
- static bool referencesStream(const Object *stateObj, Ref refToStream);
483
- void removeStream(Ref refToStream);
484
- void removeStateStreams(const Object *state);
485
-
486
- protected:
487
- PDFDoc *doc;
488
- Object appearDict; // Annotation's AP
489
- };
490
-
491
- //------------------------------------------------------------------------
492
- // AnnotAppearanceCharacs
493
- //------------------------------------------------------------------------
494
-
495
- class POPPLER_PRIVATE_EXPORT AnnotAppearanceCharacs
496
- {
497
- public:
498
- enum AnnotAppearanceCharacsTextPos
499
- {
500
- captionNoIcon, // 0
501
- captionNoCaption, // 1
502
- captionBelow, // 2
503
- captionAbove, // 3
504
- captionRight, // 4
505
- captionLeft, // 5
506
- captionOverlaid // 6
507
- };
508
-
509
- explicit AnnotAppearanceCharacs(Dict *dict);
510
- ~AnnotAppearanceCharacs();
511
-
512
- AnnotAppearanceCharacs(const AnnotAppearanceCharacs &) = delete;
513
- AnnotAppearanceCharacs &operator=(const AnnotAppearanceCharacs &) = delete;
514
-
515
- int getRotation() const { return rotation; }
516
- const AnnotColor *getBorderColor() const { return borderColor.get(); }
517
- void setBorderColor(std::unique_ptr<AnnotColor> &&color) { borderColor = std::move(color); }
518
- const AnnotColor *getBackColor() const { return backColor.get(); }
519
- void setBackColor(std::unique_ptr<AnnotColor> &&color) { backColor = std::move(color); }
520
- const GooString *getNormalCaption() const { return normalCaption.get(); }
521
- const GooString *getRolloverCaption() { return rolloverCaption.get(); }
522
- const GooString *getAlternateCaption() { return alternateCaption.get(); }
523
- const AnnotIconFit *getIconFit() { return iconFit.get(); }
524
- AnnotAppearanceCharacsTextPos getPosition() const { return position; }
525
-
526
- std::unique_ptr<AnnotAppearanceCharacs> copy() const;
527
-
528
- protected:
529
- int rotation; // R (Default 0)
530
- std::unique_ptr<AnnotColor> borderColor; // BC
531
- std::unique_ptr<AnnotColor> backColor; // BG
532
- std::unique_ptr<GooString> normalCaption; // CA
533
- std::unique_ptr<GooString> rolloverCaption; // RC
534
- std::unique_ptr<GooString> alternateCaption; // AC
535
- // I
536
- // RI
537
- // IX
538
- std::unique_ptr<AnnotIconFit> iconFit; // IF
539
- AnnotAppearanceCharacsTextPos position; // TP (Default 0)
540
- };
541
-
542
- //------------------------------------------------------------------------
543
- // AnnotAppearanceBBox
544
- //------------------------------------------------------------------------
545
-
546
- class AnnotAppearanceBBox
547
- {
548
- public:
549
- explicit AnnotAppearanceBBox(PDFRectangle *rect);
550
-
551
- void setBorderWidth(double w) { borderWidth = w; }
552
-
553
- // The following functions operate on coords relative to [origX origY]
554
- void extendTo(double x, double y);
555
- void getBBoxRect(double bbox[4]) const;
556
-
557
- // Get boundaries in page coordinates
558
- double getPageXMin() const;
559
- double getPageYMin() const;
560
- double getPageXMax() const;
561
- double getPageYMax() const;
562
-
563
- private:
564
- double origX, origY, borderWidth;
565
- double minX, minY, maxX, maxY;
566
- };
567
-
568
- //------------------------------------------------------------------------
569
- // AnnotAppearanceBuilder
570
- //------------------------------------------------------------------------
571
- class Matrix;
572
-
573
- class AnnotAppearanceBuilder
574
- {
575
- public:
576
- AnnotAppearanceBuilder();
577
- ~AnnotAppearanceBuilder();
578
-
579
- AnnotAppearanceBuilder(const AnnotAppearanceBuilder &) = delete;
580
- AnnotAppearanceBuilder &operator=(const AnnotAppearanceBuilder &) = delete;
581
-
582
- void setDrawColor(const AnnotColor *color, bool fill);
583
- void setLineStyleForBorder(const AnnotBorder *border);
584
- void setTextFont(const Object &fontName, double fontSize);
585
- void drawCircle(double cx, double cy, double r, bool fill);
586
- void drawEllipse(double cx, double cy, double rx, double ry, bool fill, bool stroke);
587
- void drawCircleTopLeft(double cx, double cy, double r);
588
- void drawCircleBottomRight(double cx, double cy, double r);
589
- void drawLineEnding(AnnotLineEndingStyle endingStyle, double x, double y, double size, bool fill, const Matrix &m);
590
- void drawLineEndSquare(double x, double y, double size, bool fill, const Matrix &m);
591
- void drawLineEndCircle(double x, double y, double size, bool fill, const Matrix &m);
592
- void drawLineEndDiamond(double x, double y, double size, bool fill, const Matrix &m);
593
- void drawLineEndArrow(double x, double y, double size, int orientation, bool isOpen, bool fill, const Matrix &m);
594
- void drawLineEndSlash(double x, double y, double size, const Matrix &m);
595
- void drawFieldBorder(const FormField *field, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect);
596
- bool drawFormField(const FormField *field, const Form *form, const GfxResources *resources, const GooString *da, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect,
597
- const GooString *appearState, XRef *xref, Dict *resourcesDict);
598
- static double lineEndingXShorten(AnnotLineEndingStyle endingStyle, double size);
599
- static double lineEndingXExtendBBox(AnnotLineEndingStyle endingStyle, double size);
600
- void writeString(const std::string &str);
601
-
602
- void append(const char *text);
603
- void appendf(const char *fmt, ...) GOOSTRING_FORMAT;
604
-
605
- const GooString *buffer() const;
606
-
607
- private:
608
- enum DrawTextFlags
609
- {
610
- NoDrawTextFlags = 0,
611
- MultilineDrawTextFlag = 1,
612
- EmitMarkedContentDrawTextFlag = 2,
613
- ForceZapfDingbatsDrawTextFlag = 4,
614
- TurnTextToStarsDrawTextFlag = 8
615
- };
616
-
617
- bool drawListBox(const FormFieldChoice *fieldChoice, const AnnotBorder *border, const PDFRectangle *rect, const GooString *da, const GfxResources *resources, VariableTextQuadding quadding, XRef *xref, Dict *resourcesDict);
618
- bool drawFormFieldButton(const FormFieldButton *field, const GfxResources *resources, const GooString *da, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect, const GooString *appearState,
619
- XRef *xref, Dict *resourcesDict);
620
- bool drawFormFieldText(const FormFieldText *fieldText, const Form *form, const GfxResources *resources, const GooString *da, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect, XRef *xref,
621
- Dict *resourcesDict);
622
- bool drawFormFieldChoice(const FormFieldChoice *fieldChoice, const Form *form, const GfxResources *resources, const GooString *da, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect,
623
- XRef *xref, Dict *resourcesDict);
624
- bool drawSignatureFieldText(const FormFieldSignature *field, const Form *form, const GfxResources *resources, const GooString *da, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect,
625
- XRef *xref, Dict *resourcesDict);
626
- void drawSignatureFieldText(const GooString &text, const DefaultAppearance &da, const AnnotBorder *border, const PDFRectangle *rect, XRef *xref, Dict *resourcesDict, double leftMargin, bool centerVertically, bool centerHorizontally);
627
- bool drawText(const GooString *text, const GooString *da, const GfxResources *resources, const AnnotBorder *border, const AnnotAppearanceCharacs *appearCharacs, const PDFRectangle *rect, const VariableTextQuadding quadding, XRef *xref,
628
- Dict *resourcesDict, const int flags = NoDrawTextFlags, const int nCombs = 0);
629
- void drawArrowPath(double x, double y, const Matrix &m, int orientation = 1);
630
-
631
- GooString *appearBuf;
632
- };
633
-
634
- //------------------------------------------------------------------------
635
- // Annot
636
- //------------------------------------------------------------------------
637
-
638
- class POPPLER_PRIVATE_EXPORT Annot
639
- {
640
- friend class Annots;
641
- friend class Page;
642
-
643
- public:
644
- enum AnnotFlag
645
- {
646
- flagUnknown = 0x0000,
647
- flagInvisible = 0x0001,
648
- flagHidden = 0x0002,
649
- flagPrint = 0x0004,
650
- flagNoZoom = 0x0008,
651
- flagNoRotate = 0x0010,
652
- flagNoView = 0x0020,
653
- flagReadOnly = 0x0040,
654
- flagLocked = 0x0080,
655
- flagToggleNoView = 0x0100,
656
- flagLockedContents = 0x0200
657
- };
658
-
659
- enum AnnotSubtype
660
- {
661
- typeUnknown, // 0
662
- typeText, // Text 1
663
- typeLink, // Link 2
664
- typeFreeText, // FreeText 3
665
- typeLine, // Line 4
666
- typeSquare, // Square 5
667
- typeCircle, // Circle 6
668
- typePolygon, // Polygon 7
669
- typePolyLine, // PolyLine 8
670
- typeHighlight, // Highlight 9
671
- typeUnderline, // Underline 10
672
- typeSquiggly, // Squiggly 11
673
- typeStrikeOut, // StrikeOut 12
674
- typeStamp, // Stamp 13
675
- typeCaret, // Caret 14
676
- typeInk, // Ink 15
677
- typePopup, // Popup 16
678
- typeFileAttachment, // FileAttachment 17
679
- typeSound, // Sound 18
680
- typeMovie, // Movie 19
681
- typeWidget, // Widget 20
682
- typeScreen, // Screen 21
683
- typePrinterMark, // PrinterMark 22
684
- typeTrapNet, // TrapNet 23
685
- typeWatermark, // Watermark 24
686
- type3D, // 3D 25
687
- typeRichMedia // RichMedia 26
688
- };
689
-
690
- /**
691
- * Describes the additional actions of a screen or widget annotation.
692
- */
693
- enum AdditionalActionsType
694
- {
695
- actionCursorEntering, ///< Performed when the cursor enters the annotation's active area
696
- actionCursorLeaving, ///< Performed when the cursor exists the annotation's active area
697
- actionMousePressed, ///< Performed when the mouse button is pressed inside the annotation's active area
698
- actionMouseReleased, ///< Performed when the mouse button is released inside the annotation's active area
699
- actionFocusIn, ///< Performed when the annotation receives the input focus
700
- actionFocusOut, ///< Performed when the annotation loses the input focus
701
- actionPageOpening, ///< Performed when the page containing the annotation is opened
702
- actionPageClosing, ///< Performed when the page containing the annotation is closed
703
- actionPageVisible, ///< Performed when the page containing the annotation becomes visible
704
- actionPageInvisible ///< Performed when the page containing the annotation becomes invisible
705
- };
706
-
707
- enum FormAdditionalActionsType
708
- {
709
- actionFieldModified, ///< Performed when the when the user modifies the field
710
- actionFormatField, ///< Performed before the field is formatted to display its value
711
- actionValidateField, ///< Performed when the field value changes
712
- actionCalculateField, ///< Performed when the field needs to be recalculated
713
- };
714
-
715
- Annot(PDFDoc *docA, PDFRectangle *rectA);
716
- Annot(PDFDoc *docA, Object &&dictObject);
717
- Annot(PDFDoc *docA, Object &&dictObject, const Object *obj);
718
- bool isOk() { return ok; }
719
-
720
- void incRefCnt();
721
- void decRefCnt();
722
-
723
- virtual void draw(Gfx *gfx, bool printing);
724
- // Get the resource dict of the appearance stream
725
- virtual Object getAppearanceResDict();
726
-
727
- bool match(const Ref *refA) const { return ref == *refA; }
728
-
729
- double getXMin();
730
- double getYMin();
731
- double getXMax();
732
- double getYMax();
733
-
734
- void setRect(const PDFRectangle *rect);
735
- void setRect(double x1, double y1, double x2, double y2);
736
-
737
- // Sets the annot contents to new_content
738
- // new_content should never be NULL
739
- virtual void setContents(std::unique_ptr<GooString> &&new_content);
740
- void setName(GooString *new_name);
741
- void setModified(GooString *new_modified);
742
- void setFlags(unsigned int new_flags);
743
-
744
- void setBorder(std::unique_ptr<AnnotBorder> &&new_border);
745
- void setColor(std::unique_ptr<AnnotColor> &&new_color);
746
-
747
- void setAppearanceState(const char *state);
748
-
749
- // getters
750
- PDFDoc *getDoc() const { return doc; }
751
- bool getHasRef() const { return hasRef; }
752
- Ref getRef() const { return ref; }
753
- const Object &getAnnotObj() const { return annotObj; }
754
- AnnotSubtype getType() const { return type; }
755
- const PDFRectangle &getRect() const { return *rect; }
756
- void getRect(double *x1, double *y1, double *x2, double *y2) const;
757
- const GooString *getContents() const { return contents.get(); }
758
- int getPageNum() const { return page; }
759
- const GooString *getName() const { return name.get(); }
760
- const GooString *getModified() const { return modified.get(); }
761
- unsigned int getFlags() const { return flags; }
762
- Object getAppearance() const;
763
- void setNewAppearance(Object &&newAppearance);
764
- AnnotAppearance *getAppearStreams() const { return appearStreams.get(); }
765
- const GooString *getAppearState() const { return appearState.get(); }
766
- AnnotBorder *getBorder() const { return border.get(); }
767
- AnnotColor *getColor() const { return color.get(); }
768
- int getTreeKey() const { return treeKey; }
769
-
770
- int getId() { return ref.num; }
771
-
772
- // Check if point is inside the annot rectangle.
773
- bool inRect(double x, double y) const;
774
-
775
- static void layoutText(const GooString *text, GooString *outBuf, int *i, const GfxFont &font, double *width, double widthLimit, int *charCount, bool noReencode);
776
-
777
- private:
778
- void readArrayNum(Object *pdfArray, int key, double *value);
779
- // write vStr[i:j[ in appearBuf
780
-
781
- void initialize(PDFDoc *docA, Dict *dict);
782
- void setPage(int pageIndex, bool updateP); // Called by Page::addAnnot and Annots ctor
783
-
784
- protected:
785
- virtual ~Annot();
786
- virtual void removeReferencedObjects(); // Called by Page::removeAnnot
787
- Object createForm(const GooString *appearBuf, const double *bbox, bool transparencyGroup, Dict *resDict);
788
- Object createForm(const GooString *appearBuf, const double *bbox, bool transparencyGroup, Object &&resDictObject); // overload to support incRef/decRef
789
- Dict *createResourcesDict(const char *formName, Object &&formStream, const char *stateName, double opacity, const char *blendMode);
790
- bool isVisible(bool printing);
791
- int getRotation() const;
792
-
793
- // Updates the field key of the annotation dictionary
794
- // and sets M to the current time
795
- void update(const char *key, Object &&value);
796
-
797
- // Delete appearance streams and reset appearance state
798
- virtual void invalidateAppearance();
799
-
800
- Object annotObj;
801
-
802
- std::atomic_int refCnt;
803
-
804
- // required data
805
- AnnotSubtype type; // Annotation type
806
- std::unique_ptr<PDFRectangle> rect; // Rect
807
-
808
- // optional data
809
- std::unique_ptr<GooString> contents; // Contents
810
- std::unique_ptr<GooString> name; // NM
811
- std::unique_ptr<GooString> modified; // M
812
- int page; // P
813
- unsigned int flags; // F (must be a 32 bit unsigned int)
814
- std::unique_ptr<AnnotAppearance> appearStreams; // AP
815
- Object appearance; // a reference to the Form XObject stream
816
- // for the normal appearance
817
- std::unique_ptr<AnnotAppearanceBBox> appearBBox; // BBox of generated appearance
818
- std::unique_ptr<GooString> appearState; // AS
819
- int treeKey; // Struct Parent;
820
- Object oc; // OC
821
-
822
- PDFDoc *doc;
823
- Ref ref; // object ref identifying this annotation
824
- std::unique_ptr<AnnotBorder> border; // Border, BS
825
- std::unique_ptr<AnnotColor> color; // C
826
- bool ok;
827
-
828
- bool hasRef;
829
- mutable std::recursive_mutex mutex;
830
- };
831
-
832
- //------------------------------------------------------------------------
833
- // AnnotPopup
834
- //------------------------------------------------------------------------
835
-
836
- class POPPLER_PRIVATE_EXPORT AnnotPopup : public Annot
837
- {
838
- public:
839
- AnnotPopup(PDFDoc *docA, PDFRectangle *rect);
840
- AnnotPopup(PDFDoc *docA, Object &&dictObject, const Object *obj);
841
- ~AnnotPopup() override;
842
-
843
- bool hasParent() const { return parentRef != Ref::INVALID(); }
844
- void setParent(Annot *parentA);
845
- bool getOpen() const { return open; }
846
- void setOpen(bool openA);
847
-
848
- protected:
849
- void initialize(PDFDoc *docA, Dict *dict);
850
-
851
- Ref parentRef; // Parent
852
- bool open; // Open
853
- };
854
-
855
- //------------------------------------------------------------------------
856
- // AnnotMarkup
857
- //------------------------------------------------------------------------
858
-
859
- class POPPLER_PRIVATE_EXPORT AnnotMarkup : public Annot
860
- {
861
- public:
862
- enum AnnotMarkupReplyType
863
- {
864
- replyTypeR, // R
865
- replyTypeGroup // Group
866
- };
867
-
868
- AnnotMarkup(PDFDoc *docA, PDFRectangle *rect);
869
- AnnotMarkup(PDFDoc *docA, Object &&dictObject, const Object *obj);
870
- ~AnnotMarkup() override;
871
-
872
- // getters
873
- const GooString *getLabel() const { return label.get(); }
874
- AnnotPopup *getPopup() const { return popup.get(); }
875
- double getOpacity() const { return opacity; }
876
- // getRC
877
- const GooString *getDate() const { return date.get(); }
878
- bool isInReplyTo() const { return inReplyTo != Ref::INVALID(); }
879
- int getInReplyToID() const { return inReplyTo.num; }
880
- const GooString *getSubject() const { return subject.get(); }
881
- AnnotMarkupReplyType getReplyTo() const { return replyTo; }
882
- AnnotExternalDataType getExData() const { return exData; }
883
-
884
- // The annotation takes the ownership of new_popup
885
- void setPopup(std::unique_ptr<AnnotPopup> &&new_popup);
886
- void setLabel(std::unique_ptr<GooString> &&new_label);
887
- void setOpacity(double opacityA);
888
- void setDate(GooString *new_date);
889
-
890
- protected:
891
- void removeReferencedObjects() override;
892
-
893
- std::unique_ptr<GooString> label; // T (Default author)
894
- std::unique_ptr<AnnotPopup> popup; // Popup
895
- double opacity; // CA (Default 1.0)
896
- // RC
897
- std::unique_ptr<GooString> date; // CreationDate
898
- Ref inReplyTo; // IRT
899
- std::unique_ptr<GooString> subject; // Subj
900
- AnnotMarkupReplyType replyTo; // RT (Default R)
901
- // this object is overridden by the custom intent fields defined in some
902
- // annotation types.
903
- // GooString *intent; // IT
904
- AnnotExternalDataType exData; // ExData
905
-
906
- private:
907
- void initialize(PDFDoc *docA, Dict *dict);
908
- };
909
-
910
- //------------------------------------------------------------------------
911
- // AnnotText
912
- //------------------------------------------------------------------------
913
-
914
- class POPPLER_PRIVATE_EXPORT AnnotText : public AnnotMarkup
915
- {
916
- public:
917
- enum AnnotTextState
918
- {
919
- stateUnknown,
920
- // Marked state model
921
- stateMarked, // Marked
922
- stateUnmarked, // Unmarked
923
- // Review state model
924
- stateAccepted, // Accepted
925
- stateRejected, // Rejected
926
- stateCancelled, // Cancelled
927
- stateCompleted, // Completed
928
- stateNone // None
929
- };
930
-
931
- AnnotText(PDFDoc *docA, PDFRectangle *rect);
932
- AnnotText(PDFDoc *docA, Object &&dictObject, const Object *obj);
933
- ~AnnotText() override;
934
-
935
- void draw(Gfx *gfx, bool printing) override;
936
-
937
- // getters
938
- bool getOpen() const { return open; }
939
- const GooString *getIcon() const { return icon.get(); }
940
- AnnotTextState getState() const { return state; }
941
-
942
- void setOpen(bool openA);
943
- void setIcon(GooString *new_icon);
944
-
945
- private:
946
- void initialize(PDFDoc *docA, Dict *dict);
947
-
948
- bool open; // Open (Default false)
949
- std::unique_ptr<GooString> icon; // Name (Default Note)
950
- AnnotTextState state; // State (Default Umarked if
951
- // StateModel Marked
952
- // None if StareModel Review)
953
- };
954
-
955
- //------------------------------------------------------------------------
956
- // AnnotMovie
957
- //------------------------------------------------------------------------
958
-
959
- class POPPLER_PRIVATE_EXPORT AnnotMovie : public Annot
960
- {
961
- public:
962
- AnnotMovie(PDFDoc *docA, PDFRectangle *rect, Movie *movieA);
963
- AnnotMovie(PDFDoc *docA, Object &&dictObject, const Object *obj);
964
- ~AnnotMovie() override;
965
-
966
- void draw(Gfx *gfx, bool printing) override;
967
-
968
- const GooString *getTitle() const { return title.get(); }
969
- Movie *getMovie() { return movie.get(); }
970
-
971
- private:
972
- void initialize(PDFDoc *docA, Dict *dict);
973
-
974
- std::unique_ptr<GooString> title; // T
975
- std::unique_ptr<Movie> movie; // Movie + A
976
- };
977
-
978
- //------------------------------------------------------------------------
979
- // AnnotScreen
980
- //------------------------------------------------------------------------
981
-
982
- class POPPLER_PRIVATE_EXPORT AnnotScreen : public Annot
983
- {
984
- public:
985
- AnnotScreen(PDFDoc *docA, PDFRectangle *rect);
986
- AnnotScreen(PDFDoc *docA, Object &&dictObject, const Object *obj);
987
- ~AnnotScreen() override;
988
-
989
- const GooString *getTitle() const { return title.get(); }
990
-
991
- AnnotAppearanceCharacs *getAppearCharacs() { return appearCharacs.get(); }
992
- LinkAction *getAction() { return action.get(); } // The caller should not delete the result
993
- std::unique_ptr<LinkAction> getAdditionalAction(AdditionalActionsType type);
994
-
995
- private:
996
- void initialize(PDFDoc *docA, Dict *dict);
997
-
998
- std::unique_ptr<GooString> title; // T
999
-
1000
- std::unique_ptr<AnnotAppearanceCharacs> appearCharacs; // MK
1001
-
1002
- std::unique_ptr<LinkAction> action; // A
1003
- Object additionalActions; // AA
1004
- };
1005
-
1006
- //------------------------------------------------------------------------
1007
- // AnnotLink
1008
- //------------------------------------------------------------------------
1009
-
1010
- class AnnotLink : public Annot
1011
- {
1012
- public:
1013
- enum AnnotLinkEffect
1014
- {
1015
- effectNone, // N
1016
- effectInvert, // I
1017
- effectOutline, // O
1018
- effectPush // P
1019
- };
1020
-
1021
- AnnotLink(PDFDoc *docA, PDFRectangle *rect);
1022
- AnnotLink(PDFDoc *docA, Object &&dictObject, const Object *obj);
1023
- ~AnnotLink() override;
1024
-
1025
- void draw(Gfx *gfx, bool printing) override;
1026
-
1027
- // getters
1028
- LinkAction *getAction() const { return action.get(); }
1029
- AnnotLinkEffect getLinkEffect() const { return linkEffect; }
1030
- AnnotQuadrilaterals *getQuadrilaterals() const { return quadrilaterals.get(); }
1031
-
1032
- protected:
1033
- void initialize(PDFDoc *docA, Dict *dict);
1034
-
1035
- std::unique_ptr<LinkAction> action; // A, Dest
1036
- AnnotLinkEffect linkEffect; // H (Default I)
1037
- // Dict *uriAction; // PA
1038
-
1039
- std::unique_ptr<AnnotQuadrilaterals> quadrilaterals; // QuadPoints
1040
- };
1041
-
1042
- //------------------------------------------------------------------------
1043
- // AnnotFreeText
1044
- //------------------------------------------------------------------------
1045
-
1046
- class POPPLER_PRIVATE_EXPORT AnnotFreeText : public AnnotMarkup
1047
- {
1048
- public:
1049
- enum AnnotFreeTextIntent
1050
- {
1051
- intentFreeText, // FreeText
1052
- intentFreeTextCallout, // FreeTextCallout
1053
- intentFreeTextTypeWriter // FreeTextTypeWriter
1054
- };
1055
-
1056
- static const double undefinedFontPtSize;
1057
-
1058
- AnnotFreeText(PDFDoc *docA, PDFRectangle *rect, const DefaultAppearance &da);
1059
- AnnotFreeText(PDFDoc *docA, Object &&dictObject, const Object *obj);
1060
- ~AnnotFreeText() override;
1061
-
1062
- void draw(Gfx *gfx, bool printing) override;
1063
- Object getAppearanceResDict() override;
1064
- void setContents(std::unique_ptr<GooString> &&new_content) override;
1065
-
1066
- void setDefaultAppearance(const DefaultAppearance &da);
1067
- void setQuadding(VariableTextQuadding new_quadding);
1068
- void setStyleString(GooString *new_string);
1069
- void setCalloutLine(AnnotCalloutLine *line);
1070
- void setIntent(AnnotFreeTextIntent new_intent);
1071
-
1072
- // getters
1073
- std::unique_ptr<DefaultAppearance> getDefaultAppearance() const;
1074
- VariableTextQuadding getQuadding() const { return quadding; }
1075
- // return rc
1076
- const GooString *getStyleString() const { return styleString.get(); }
1077
- AnnotCalloutLine *getCalloutLine() const { return calloutLine.get(); }
1078
- AnnotFreeTextIntent getIntent() const { return intent; }
1079
- AnnotBorderEffect *getBorderEffect() const { return borderEffect.get(); }
1080
- PDFRectangle *getRectangle() const { return rectangle.get(); }
1081
- AnnotLineEndingStyle getEndStyle() const { return endStyle; }
1082
-
1083
- protected:
1084
- void initialize(PDFDoc *docA, Dict *dict);
1085
- void generateFreeTextAppearance();
1086
-
1087
- // required
1088
- std::unique_ptr<GooString> appearanceString; // DA
1089
-
1090
- // optional
1091
- VariableTextQuadding quadding; // Q (Default 0)
1092
- // RC
1093
- std::unique_ptr<GooString> styleString; // DS
1094
- std::unique_ptr<AnnotCalloutLine> calloutLine; // CL
1095
- AnnotFreeTextIntent intent; // IT
1096
- std::unique_ptr<AnnotBorderEffect> borderEffect; // BE
1097
- std::unique_ptr<PDFRectangle> rectangle; // RD
1098
- // inherited from Annot
1099
- // AnnotBorderBS border; // BS
1100
- AnnotLineEndingStyle endStyle; // LE (Default None)
1101
- };
1102
-
1103
- //------------------------------------------------------------------------
1104
- // AnnotLine
1105
- //------------------------------------------------------------------------
1106
-
1107
- class POPPLER_PRIVATE_EXPORT AnnotLine : public AnnotMarkup
1108
- {
1109
- public:
1110
- enum AnnotLineIntent
1111
- {
1112
- intentLineArrow, // LineArrow
1113
- intentLineDimension // LineDimension
1114
- };
1115
-
1116
- enum AnnotLineCaptionPos
1117
- {
1118
- captionPosInline, // Inline
1119
- captionPosTop // Top
1120
- };
1121
-
1122
- AnnotLine(PDFDoc *docA, PDFRectangle *rect);
1123
- AnnotLine(PDFDoc *docA, Object &&dictObject, const Object *obj);
1124
- ~AnnotLine() override;
1125
-
1126
- void draw(Gfx *gfx, bool printing) override;
1127
- Object getAppearanceResDict() override;
1128
- void setContents(std::unique_ptr<GooString> &&new_content) override;
1129
-
1130
- void setVertices(double x1, double y1, double x2, double y2);
1131
- void setStartEndStyle(AnnotLineEndingStyle start, AnnotLineEndingStyle end);
1132
- void setInteriorColor(std::unique_ptr<AnnotColor> &&new_color);
1133
- void setLeaderLineLength(double len);
1134
- void setLeaderLineExtension(double len);
1135
- void setCaption(bool new_cap);
1136
- void setIntent(AnnotLineIntent new_intent);
1137
-
1138
- // getters
1139
- AnnotLineEndingStyle getStartStyle() const { return startStyle; }
1140
- AnnotLineEndingStyle getEndStyle() const { return endStyle; }
1141
- AnnotColor *getInteriorColor() const { return interiorColor.get(); }
1142
- double getLeaderLineLength() const { return leaderLineLength; }
1143
- double getLeaderLineExtension() const { return leaderLineExtension; }
1144
- bool getCaption() const { return caption; }
1145
- AnnotLineIntent getIntent() const { return intent; }
1146
- double getLeaderLineOffset() const { return leaderLineOffset; }
1147
- AnnotLineCaptionPos getCaptionPos() const { return captionPos; }
1148
- Dict *getMeasure() const { return measure; }
1149
- double getCaptionTextHorizontal() const { return captionTextHorizontal; }
1150
- double getCaptionTextVertical() const { return captionTextVertical; }
1151
- double getX1() const { return coord1->getX(); }
1152
- double getY1() const { return coord1->getY(); }
1153
- double getX2() const { return coord2->getX(); }
1154
- double getY2() const { return coord2->getY(); }
1155
-
1156
- protected:
1157
- void initialize(PDFDoc *docA, Dict *dict);
1158
- void generateLineAppearance();
1159
-
1160
- // required
1161
- std::unique_ptr<AnnotCoord> coord1;
1162
- std::unique_ptr<AnnotCoord> coord2;
1163
-
1164
- // optional
1165
- // inherited from Annot
1166
- // AnnotBorderBS border; // BS
1167
- AnnotLineEndingStyle startStyle; // LE (Default [/None /None])
1168
- AnnotLineEndingStyle endStyle; //
1169
- std::unique_ptr<AnnotColor> interiorColor; // IC
1170
- double leaderLineLength; // LL (Default 0)
1171
- double leaderLineExtension; // LLE (Default 0)
1172
- bool caption; // Cap (Default false)
1173
- AnnotLineIntent intent; // IT
1174
- double leaderLineOffset; // LLO
1175
- AnnotLineCaptionPos captionPos; // CP (Default Inline)
1176
- Dict *measure; // Measure
1177
- double captionTextHorizontal; // CO (Default [0, 0])
1178
- double captionTextVertical; //
1179
- };
1180
-
1181
- //------------------------------------------------------------------------
1182
- // AnnotTextMarkup
1183
- //------------------------------------------------------------------------
1184
-
1185
- class POPPLER_PRIVATE_EXPORT AnnotTextMarkup : public AnnotMarkup
1186
- {
1187
- public:
1188
- AnnotTextMarkup(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
1189
- AnnotTextMarkup(PDFDoc *docA, Object &&dictObject, const Object *obj);
1190
- ~AnnotTextMarkup() override;
1191
-
1192
- void draw(Gfx *gfx, bool printing) override;
1193
-
1194
- // typeHighlight, typeUnderline, typeSquiggly or typeStrikeOut
1195
- void setType(AnnotSubtype new_type);
1196
-
1197
- void setQuadrilaterals(AnnotQuadrilaterals *quadPoints);
1198
-
1199
- AnnotQuadrilaterals *getQuadrilaterals() const { return quadrilaterals.get(); }
1200
-
1201
- protected:
1202
- void initialize(PDFDoc *docA, Dict *dict);
1203
-
1204
- std::unique_ptr<AnnotQuadrilaterals> quadrilaterals; // QuadPoints
1205
-
1206
- private:
1207
- bool shouldCreateApperance(Gfx *gfx) const;
1208
- };
1209
-
1210
- //------------------------------------------------------------------------
1211
- // AnnotStamp
1212
- //------------------------------------------------------------------------
1213
-
1214
- class POPPLER_PRIVATE_EXPORT AnnotStamp : public AnnotMarkup
1215
- {
1216
- public:
1217
- AnnotStamp(PDFDoc *docA, PDFRectangle *rect);
1218
- AnnotStamp(PDFDoc *docA, Object &&dictObject, const Object *obj);
1219
- ~AnnotStamp() override;
1220
-
1221
- void draw(Gfx *gfx, bool printing) override;
1222
-
1223
- void setIcon(GooString *new_icon);
1224
-
1225
- void setCustomImage(AnnotStampImageHelper *stampImageHelperA);
1226
-
1227
- void clearCustomImage();
1228
-
1229
- // getters
1230
- const GooString *getIcon() const { return icon.get(); }
1231
-
1232
- private:
1233
- void initialize(PDFDoc *docA, Dict *dict);
1234
- void generateStampDefaultAppearance();
1235
- void generateStampCustomAppearance();
1236
-
1237
- std::unique_ptr<GooString> icon; // Name (Default Draft)
1238
- AnnotStampImageHelper *stampImageHelper;
1239
- Ref updatedAppearanceStream;
1240
- };
1241
-
1242
- //------------------------------------------------------------------------
1243
- // AnnotGeometry
1244
- //------------------------------------------------------------------------
1245
-
1246
- class POPPLER_PRIVATE_EXPORT AnnotGeometry : public AnnotMarkup
1247
- {
1248
- public:
1249
- AnnotGeometry(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
1250
- AnnotGeometry(PDFDoc *docA, Object &&dictObject, const Object *obj);
1251
- ~AnnotGeometry() override;
1252
-
1253
- void draw(Gfx *gfx, bool printing) override;
1254
-
1255
- void setType(AnnotSubtype new_type); // typeSquare or typeCircle
1256
- void setInteriorColor(std::unique_ptr<AnnotColor> &&new_color);
1257
-
1258
- // getters
1259
- AnnotColor *getInteriorColor() const { return interiorColor.get(); }
1260
- AnnotBorderEffect *getBorderEffect() const { return borderEffect.get(); }
1261
- PDFRectangle *getGeometryRect() const { return geometryRect.get(); }
1262
-
1263
- private:
1264
- void initialize(PDFDoc *docA, Dict *dict);
1265
-
1266
- std::unique_ptr<AnnotColor> interiorColor; // IC
1267
- std::unique_ptr<AnnotBorderEffect> borderEffect; // BE
1268
- std::unique_ptr<PDFRectangle> geometryRect; // RD (combined with Rect)
1269
- };
1270
-
1271
- //------------------------------------------------------------------------
1272
- // AnnotPolygon
1273
- //------------------------------------------------------------------------
1274
-
1275
- class POPPLER_PRIVATE_EXPORT AnnotPolygon : public AnnotMarkup
1276
- {
1277
- public:
1278
- enum AnnotPolygonIntent
1279
- {
1280
- polygonCloud, // PolygonCloud
1281
- polylineDimension, // PolyLineDimension
1282
- polygonDimension // PolygonDimension
1283
- };
1284
-
1285
- AnnotPolygon(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
1286
- AnnotPolygon(PDFDoc *docA, Object &&dictObject, const Object *obj);
1287
- ~AnnotPolygon() override;
1288
-
1289
- void draw(Gfx *gfx, bool printing) override;
1290
- void generatePolyLineAppearance(AnnotAppearanceBuilder *appearBuilder);
1291
- void setType(AnnotSubtype new_type); // typePolygon or typePolyLine
1292
- void setVertices(AnnotPath *path);
1293
- void setStartEndStyle(AnnotLineEndingStyle start, AnnotLineEndingStyle end);
1294
- void setInteriorColor(std::unique_ptr<AnnotColor> &&new_color);
1295
- void setIntent(AnnotPolygonIntent new_intent);
1296
-
1297
- // getters
1298
- AnnotPath *getVertices() const { return vertices.get(); }
1299
- AnnotLineEndingStyle getStartStyle() const { return startStyle; }
1300
- AnnotLineEndingStyle getEndStyle() const { return endStyle; }
1301
- AnnotColor *getInteriorColor() const { return interiorColor.get(); }
1302
- AnnotBorderEffect *getBorderEffect() const { return borderEffect.get(); }
1303
- AnnotPolygonIntent getIntent() const { return intent; }
1304
-
1305
- private:
1306
- void initialize(PDFDoc *docA, Dict *dict);
1307
-
1308
- // required
1309
- std::unique_ptr<AnnotPath> vertices; // Vertices
1310
-
1311
- // optional
1312
- AnnotLineEndingStyle startStyle; // LE (Default [/None /None])
1313
- AnnotLineEndingStyle endStyle; //
1314
- // inherited from Annot
1315
- // AnnotBorderBS border; // BS
1316
- std::unique_ptr<AnnotColor> interiorColor; // IC
1317
- std::unique_ptr<AnnotBorderEffect> borderEffect; // BE
1318
- AnnotPolygonIntent intent; // IT
1319
- // Measure
1320
- };
1321
-
1322
- //------------------------------------------------------------------------
1323
- // AnnotCaret
1324
- //------------------------------------------------------------------------
1325
-
1326
- class POPPLER_PRIVATE_EXPORT AnnotCaret : public AnnotMarkup
1327
- {
1328
- public:
1329
- enum AnnotCaretSymbol
1330
- {
1331
- symbolNone, // None
1332
- symbolP // P
1333
- };
1334
-
1335
- AnnotCaret(PDFDoc *docA, PDFRectangle *rect);
1336
- AnnotCaret(PDFDoc *docA, Object &&dictObject, const Object *obj);
1337
- ~AnnotCaret() override;
1338
-
1339
- void setSymbol(AnnotCaretSymbol new_symbol);
1340
-
1341
- // getters
1342
- AnnotCaretSymbol getSymbol() const { return symbol; }
1343
- PDFRectangle *getCaretRect() const { return caretRect.get(); }
1344
-
1345
- private:
1346
- void initialize(PDFDoc *docA, Dict *dict);
1347
-
1348
- AnnotCaretSymbol symbol; // Sy (Default None)
1349
- std::unique_ptr<PDFRectangle> caretRect; // RD (combined with Rect)
1350
- };
1351
-
1352
- //------------------------------------------------------------------------
1353
- // AnnotInk
1354
- //------------------------------------------------------------------------
1355
-
1356
- class POPPLER_PRIVATE_EXPORT AnnotInk : public AnnotMarkup
1357
- {
1358
- public:
1359
- AnnotInk(PDFDoc *docA, PDFRectangle *rect);
1360
- AnnotInk(PDFDoc *docA, Object &&dictObject, const Object *obj);
1361
- ~AnnotInk() override;
1362
-
1363
- void draw(Gfx *gfx, bool printing) override;
1364
-
1365
- void setInkList(AnnotPath **paths, int n_paths);
1366
-
1367
- // getters
1368
- AnnotPath **getInkList() const { return inkList; }
1369
- int getInkListLength() const { return inkListLength; }
1370
-
1371
- private:
1372
- void initialize(PDFDoc *docA, Dict *dict);
1373
- void writeInkList(AnnotPath **paths, int n_paths, Array *dest_array);
1374
- void parseInkList(Array *src_array);
1375
- void freeInkList();
1376
-
1377
- // required
1378
- AnnotPath **inkList; // InkList
1379
- int inkListLength;
1380
-
1381
- // optional
1382
- // inherited from Annot
1383
- // AnnotBorderBS border; // BS
1384
- };
1385
-
1386
- //------------------------------------------------------------------------
1387
- // AnnotFileAttachment
1388
- //------------------------------------------------------------------------
1389
-
1390
- class AnnotFileAttachment : public AnnotMarkup
1391
- {
1392
- public:
1393
- AnnotFileAttachment(PDFDoc *docA, PDFRectangle *rect, GooString *filename);
1394
- AnnotFileAttachment(PDFDoc *docA, Object &&dictObject, const Object *obj);
1395
- ~AnnotFileAttachment() override;
1396
-
1397
- void draw(Gfx *gfx, bool printing) override;
1398
-
1399
- // getters
1400
- Object *getFile() { return &file; }
1401
- const GooString *getName() const { return name.get(); }
1402
-
1403
- private:
1404
- void initialize(PDFDoc *docA, Dict *dict);
1405
-
1406
- // required
1407
- Object file; // FS
1408
-
1409
- // optional
1410
- std::unique_ptr<GooString> name; // Name
1411
- };
1412
-
1413
- //------------------------------------------------------------------------
1414
- // AnnotSound
1415
- //------------------------------------------------------------------------
1416
-
1417
- class AnnotSound : public AnnotMarkup
1418
- {
1419
- public:
1420
- AnnotSound(PDFDoc *docA, PDFRectangle *rect, Sound *soundA);
1421
- AnnotSound(PDFDoc *docA, Object &&dictObject, const Object *obj);
1422
- ~AnnotSound() override;
1423
-
1424
- void draw(Gfx *gfx, bool printing) override;
1425
-
1426
- // getters
1427
- Sound *getSound() { return sound.get(); }
1428
- const GooString *getName() const { return name.get(); }
1429
-
1430
- private:
1431
- void initialize(PDFDoc *docA, Dict *dict);
1432
-
1433
- // required
1434
- std::unique_ptr<Sound> sound; // Sound
1435
-
1436
- // optional
1437
- std::unique_ptr<GooString> name; // Name
1438
- };
1439
-
1440
- //------------------------------------------------------------------------
1441
- // AnnotWidget
1442
- //------------------------------------------------------------------------
1443
-
1444
- class POPPLER_PRIVATE_EXPORT AnnotWidget : public Annot
1445
- {
1446
- public:
1447
- enum AnnotWidgetHighlightMode
1448
- {
1449
- highlightModeNone, // N
1450
- highlightModeInvert, // I
1451
- highlightModeOutline, // O
1452
- highlightModePush // P,T
1453
- };
1454
-
1455
- AnnotWidget(PDFDoc *docA, Object &&dictObject, const Object *obj);
1456
- AnnotWidget(PDFDoc *docA, Object *dictObject, Object *obj, FormField *fieldA);
1457
- ~AnnotWidget() override;
1458
-
1459
- void draw(Gfx *gfx, bool printing) override;
1460
- void invalidateAppearance() override;
1461
-
1462
- void generateFieldAppearance();
1463
- void updateAppearanceStream();
1464
-
1465
- AnnotWidgetHighlightMode getMode() { return mode; }
1466
- AnnotAppearanceCharacs *getAppearCharacs() { return appearCharacs.get(); }
1467
- void setAppearCharacs(std::unique_ptr<AnnotAppearanceCharacs> &&appearCharacsA) { appearCharacs = std::move(appearCharacsA); }
1468
- LinkAction *getAction() { return action.get(); } // The caller should not delete the result
1469
- std::unique_ptr<LinkAction> getAdditionalAction(AdditionalActionsType type);
1470
- std::unique_ptr<LinkAction> getFormAdditionalAction(FormAdditionalActionsType type);
1471
- Dict *getParent() { return parent; }
1472
-
1473
- bool setFormAdditionalAction(FormAdditionalActionsType type, const GooString &js);
1474
-
1475
- void setField(FormField *f) { field = f; };
1476
-
1477
- private:
1478
- void initialize(PDFDoc *docA, Dict *dict);
1479
-
1480
- Form *form;
1481
- FormField *field; // FormField object for this annotation
1482
- AnnotWidgetHighlightMode mode; // H (Default I)
1483
- std::unique_ptr<AnnotAppearanceCharacs> appearCharacs; // MK
1484
- std::unique_ptr<LinkAction> action; // A
1485
- Object additionalActions; // AA
1486
- // inherited from Annot
1487
- // AnnotBorderBS border; // BS
1488
- Dict *parent; // Parent
1489
- Ref updatedAppearanceStream; // {-1,-1} if updateAppearanceStream has never been called
1490
- };
1491
-
1492
- //------------------------------------------------------------------------
1493
- // Annot3D
1494
- //------------------------------------------------------------------------
1495
-
1496
- class Annot3D : public Annot
1497
- {
1498
- class Activation
1499
- {
1500
- public:
1501
- enum ActivationATrigger
1502
- {
1503
- aTriggerUnknown,
1504
- aTriggerPageOpened, // PO
1505
- aTriggerPageVisible, // PV
1506
- aTriggerUserAction // XA
1507
- };
1508
-
1509
- enum ActivationAState
1510
- {
1511
- aStateUnknown,
1512
- aStateEnabled, // I
1513
- aStateDisabled // L
1514
- };
1515
-
1516
- enum ActivationDTrigger
1517
- {
1518
- dTriggerUnknown,
1519
- dTriggerPageClosed, // PC
1520
- dTriggerPageInvisible, // PI
1521
- dTriggerUserAction // XD
1522
- };
1523
-
1524
- enum ActivationDState
1525
- {
1526
- dStateUnknown,
1527
- dStateUninstantiaded, // U
1528
- dStateInstantiated, // I
1529
- dStateLive // L
1530
- };
1531
-
1532
- explicit Activation(Dict *dict);
1533
-
1534
- private:
1535
- ActivationATrigger aTrigger; // A (Default XA)
1536
- ActivationAState aState; // AIS (Default L)
1537
- ActivationDTrigger dTrigger; // D (Default PI)
1538
- ActivationDState dState; // DIS (Default U)
1539
- bool displayToolbar; // TB (Default true)
1540
- bool displayNavigation; // NP (Default false);
1541
- };
1542
-
1543
- public:
1544
- Annot3D(PDFDoc *docA, PDFRectangle *rect);
1545
- Annot3D(PDFDoc *docA, Object &&dictObject, const Object *obj);
1546
- ~Annot3D() override;
1547
-
1548
- // getters
1549
-
1550
- private:
1551
- void initialize(PDFDoc *docA, Dict *dict);
1552
-
1553
- std::unique_ptr<Activation> activation; // 3DA
1554
- };
1555
-
1556
- //------------------------------------------------------------------------
1557
- // AnnotRichMedia
1558
- //------------------------------------------------------------------------
1559
-
1560
- class POPPLER_PRIVATE_EXPORT AnnotRichMedia : public Annot
1561
- {
1562
- public:
1563
- class POPPLER_PRIVATE_EXPORT Params
1564
- {
1565
- public:
1566
- explicit Params(Dict *dict);
1567
- ~Params();
1568
-
1569
- Params(const Params &) = delete;
1570
- Params &operator=(const Params &) = delete;
1571
-
1572
- const GooString *getFlashVars() const;
1573
-
1574
- private:
1575
- // optional
1576
- std::unique_ptr<GooString> flashVars; // FlashVars
1577
- };
1578
-
1579
- class POPPLER_PRIVATE_EXPORT Instance
1580
- {
1581
- public:
1582
- enum Type
1583
- {
1584
- type3D, // 3D
1585
- typeFlash, // Flash
1586
- typeSound, // Sound
1587
- typeVideo // Video
1588
- };
1589
-
1590
- explicit Instance(Dict *dict);
1591
- ~Instance();
1592
-
1593
- Instance(const Instance &) = delete;
1594
- Instance &operator=(const Instance &) = delete;
1595
-
1596
- Type getType() const;
1597
- Params *getParams() const;
1598
-
1599
- private:
1600
- // optional
1601
- Type type; // Subtype
1602
- std::unique_ptr<Params> params; // Params
1603
- };
1604
-
1605
- class POPPLER_PRIVATE_EXPORT Configuration
1606
- {
1607
- public:
1608
- enum Type
1609
- {
1610
- type3D, // 3D
1611
- typeFlash, // Flash
1612
- typeSound, // Sound
1613
- typeVideo // Video
1614
- };
1615
-
1616
- explicit Configuration(Dict *dict);
1617
- ~Configuration();
1618
-
1619
- Configuration(const Configuration &) = delete;
1620
- Configuration &operator=(const Configuration &) = delete;
1621
-
1622
- Type getType() const;
1623
- const GooString *getName() const;
1624
- int getInstancesCount() const;
1625
- Instance *getInstance(int index) const;
1626
-
1627
- private:
1628
- // optional
1629
- Type type; // Subtype
1630
- std::unique_ptr<GooString> name; // Name
1631
- Instance **instances; // Instances
1632
- int nInstances;
1633
- };
1634
-
1635
- class Content;
1636
-
1637
- class POPPLER_PRIVATE_EXPORT Asset
1638
- {
1639
- public:
1640
- Asset();
1641
- ~Asset();
1642
-
1643
- Asset(const Asset &) = delete;
1644
- Asset &operator=(const Asset &) = delete;
1645
-
1646
- const GooString *getName() const;
1647
- Object *getFileSpec() const;
1648
-
1649
- private:
1650
- friend class AnnotRichMedia::Content;
1651
-
1652
- std::unique_ptr<GooString> name;
1653
- Object fileSpec;
1654
- };
1655
-
1656
- class POPPLER_PRIVATE_EXPORT Content
1657
- {
1658
- public:
1659
- explicit Content(Dict *dict);
1660
- ~Content();
1661
-
1662
- Content(const Content &) = delete;
1663
- Content &operator=(const Content &) = delete;
1664
-
1665
- int getConfigurationsCount() const;
1666
- Configuration *getConfiguration(int index) const;
1667
-
1668
- int getAssetsCount() const;
1669
- Asset *getAsset(int index) const;
1670
-
1671
- private:
1672
- // optional
1673
- Configuration **configurations; // Configurations
1674
- int nConfigurations;
1675
-
1676
- Asset **assets; // Assets
1677
- int nAssets;
1678
- };
1679
-
1680
- class POPPLER_PRIVATE_EXPORT Activation
1681
- {
1682
- public:
1683
- enum Condition
1684
- {
1685
- conditionPageOpened, // PO
1686
- conditionPageVisible, // PV
1687
- conditionUserAction // XA
1688
- };
1689
-
1690
- explicit Activation(Dict *dict);
1691
-
1692
- Condition getCondition() const;
1693
-
1694
- private:
1695
- // optional
1696
- Condition condition;
1697
- };
1698
-
1699
- class POPPLER_PRIVATE_EXPORT Deactivation
1700
- {
1701
- public:
1702
- enum Condition
1703
- {
1704
- conditionPageClosed, // PC
1705
- conditionPageInvisible, // PI
1706
- conditionUserAction // XD
1707
- };
1708
-
1709
- explicit Deactivation(Dict *dict);
1710
-
1711
- Condition getCondition() const;
1712
-
1713
- private:
1714
- // optional
1715
- Condition condition;
1716
- };
1717
-
1718
- class POPPLER_PRIVATE_EXPORT Settings
1719
- {
1720
- public:
1721
- explicit Settings(Dict *dict);
1722
- ~Settings();
1723
-
1724
- Settings(const Settings &) = delete;
1725
- Settings &operator=(const Settings &) = delete;
1726
-
1727
- Activation *getActivation() const;
1728
- Deactivation *getDeactivation() const;
1729
-
1730
- private:
1731
- // optional
1732
- std::unique_ptr<Activation> activation;
1733
- std::unique_ptr<Deactivation> deactivation;
1734
- };
1735
-
1736
- AnnotRichMedia(PDFDoc *docA, PDFRectangle *rect);
1737
- AnnotRichMedia(PDFDoc *docA, Object &&dictObject, const Object *obj);
1738
- ~AnnotRichMedia() override;
1739
-
1740
- Content *getContent() const;
1741
-
1742
- Settings *getSettings() const;
1743
-
1744
- private:
1745
- void initialize(PDFDoc *docA, Dict *dict);
1746
-
1747
- // required
1748
- std::unique_ptr<Content> content; // RichMediaContent
1749
-
1750
- // optional
1751
- std::unique_ptr<Settings> settings; // RichMediaSettings
1752
- };
1753
-
1754
- //------------------------------------------------------------------------
1755
- // Annots
1756
- //------------------------------------------------------------------------
1757
-
1758
- class Annots
1759
- {
1760
- public:
1761
- // Build a list of Annot objects and call setPage on them
1762
- Annots(PDFDoc *docA, int page, Object *annotsObj);
1763
-
1764
- ~Annots();
1765
-
1766
- Annots(const Annots &) = delete;
1767
- Annots &operator=(const Annots &) = delete;
1768
-
1769
- // Iterate through list of annotations.
1770
- int getNumAnnots() const { return annots.size(); }
1771
- Annot *getAnnot(int i) { return annots[i]; }
1772
- void appendAnnot(Annot *annot);
1773
- bool removeAnnot(Annot *annot);
1774
-
1775
- private:
1776
- Annot *createAnnot(Object &&dictObject, const Object *obj);
1777
- Annot *findAnnot(Ref *ref);
1778
-
1779
- PDFDoc *doc;
1780
- std::vector<Annot *> annots;
1781
- };
1782
-
1783
- #endif