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.
- package/CHANGELOG.md +33 -0
- package/package.json +10 -10
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Annot.h +0 -1783
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/AnnotStampImageHelper.h +0 -68
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Array.h +0 -92
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/BBoxOutputDev.h +0 -54
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CMap.h +0 -128
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CachedFile.h +0 -149
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoFontEngine.h +0 -122
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoOutputDev.h +0 -468
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoRescaleBox.h +0 -60
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Catalog.h +0 -318
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CertificateInfo.h +0 -129
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharCodeToUnicode.h +0 -143
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharTypes.h +0 -24
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlCachedFile.h +0 -37
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlPDFDocBuilder.h +0 -32
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/DateInfo.h +0 -44
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Decrypt.h +0 -147
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Dict.h +0 -126
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Error.h +0 -59
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ErrorCodes.h +0 -54
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FDPDFDocBuilder.h +0 -36
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FILECacheLoader.h +0 -34
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FileSpec.h +0 -85
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontEncodingTables.h +0 -20
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontInfo.h +0 -109
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Form.h +0 -734
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Function.h +0 -251
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Gfx.h +0 -373
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxFont.h +0 -466
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState.h +0 -1759
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState_helpers.h +0 -90
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GlobalParams.h +0 -221
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Hints.h +0 -91
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JArithmeticDecoder.h +0 -131
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JBIG2Stream.h +0 -130
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JPEG2000Stream.h +0 -54
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JSInfo.h +0 -65
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Lexer.h +0 -113
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Linearization.h +0 -43
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Link.h +0 -566
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/LocalPDFDocBuilder.h +0 -32
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/MarkedContentOutputDev.h +0 -132
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Movie.h +0 -123
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToCharCode.h +0 -52
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToUnicodeTable.h +0 -4300
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Object.h +0 -678
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OptionalContent.h +0 -117
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Outline.h +0 -122
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OutputDev.h +0 -379
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDoc.h +0 -419
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocBuilder.h +0 -47
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocEncoding.h +0 -43
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocFactory.h +0 -58
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSOutputDev.h +0 -549
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSTokenizer.h +0 -47
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Page.h +0 -273
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PageTransition.h +0 -105
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Parser.h +0 -76
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PopplerCache.h +0 -65
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PreScanOutputDev.h +0 -148
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ProfileData.h +0 -35
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Rendition.h +0 -164
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SecurityHandler.h +0 -131
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Sound.h +0 -82
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SplashOutputDev.h +0 -413
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream-CCITT.h +0 -334
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream.h +0 -1504
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructElement.h +0 -406
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructTreeRoot.h +0 -89
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/TextOutputDev.h +0 -918
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UTF.h +0 -112
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCClassTables.h +0 -983
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCompTables.h +0 -328
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeDecompTables.h +0 -7181
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMap.h +0 -128
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapFuncs.h +0 -35
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapTables.h +0 -84
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeTypeTable.h +0 -49
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ViewerPreferences.h +0 -87
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/XRef.h +0 -325
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-destination.h +0 -69
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-document.h +0 -135
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-embedded-file.h +0 -55
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font-private.h +0 -68
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font.h +0 -95
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-global.h +0 -132
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-image.h +0 -74
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-renderer.h +0 -77
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-transition.h +0 -85
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page.h +0 -225
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-rectangle.h +0 -66
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-toc.h +0 -72
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-version.h +0 -39
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler_cpp_export.h +0 -42
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiBase.h +0 -66
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiEncodings.h +0 -43
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiIdentifier.h +0 -52
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiTrueType.h +0 -190
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1.h +0 -70
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1C.h +0 -263
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-action.h +0 -454
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-annot.h +0 -333
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-attachment.h +0 -123
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-date.h +0 -32
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-document.h +0 -541
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-enums.h +0 -191
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-features.h +0 -88
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-form-field.h +0 -254
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-layer.h +0 -50
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-macros.h +0 -42
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-media.h +0 -80
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-movie.h +0 -81
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-page.h +0 -424
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-structure-element.h +0 -425
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler.h +0 -259
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooCheckedOps.h +0 -116
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooLikely.h +0 -22
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooString.h +0 -262
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooTimer.h +0 -59
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/ImgWriter.h +0 -39
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/JpegWriter.h +0 -69
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/PNGWriter.h +0 -68
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/TiffWriter.h +0 -70
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gdir.h +0 -96
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gfile.h +0 -156
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gmem.h +0 -201
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/grandom.h +0 -21
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gstrtod.h +0 -45
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler-config.h +0 -155
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler_private_export.h +0 -42
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/Splash.h +0 -336
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashBitmap.h +0 -127
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashClip.h +0 -131
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashErrorCodes.h +0 -50
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFont.h +0 -71
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontEngine.h +0 -72
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontFile.h +0 -64
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFont.h +0 -116
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontEngine.h +0 -89
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFile.h +0 -98
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFileID.h +0 -40
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashGlyphBitmap.h +0 -23
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashMath.h +0 -215
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPath.h +0 -138
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPattern.h +0 -107
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashScreen.h +0 -87
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashState.h +0 -132
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashTypes.h +0 -248
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPath.h +0 -95
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPathScanner.h +0 -136
- package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-cpp.pc +0 -12
- package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-glib.pc +0 -12
- package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler.pc +0 -10
- package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-cpp.lib +0 -0
- package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-glib.lib +0 -0
- package/src/lib/win32/poppler-22.04.0/Library/lib/poppler.lib +0 -0
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfattach.1 +0 -60
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfdetach.1 +0 -94
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdffonts.1 +0 -128
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfimages.1 +0 -265
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfinfo.1 +0 -198
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfseparate.1 +0 -60
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftocairo.1 +0 -346
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftohtml.1 +0 -118
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftoppm.1 +0 -230
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftops.1 +0 -267
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftotext.1 +0 -157
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfunite.1 +0 -43
- package/src/lib/win32/poppler-22.04.0/share/poppler/CMakeLists.txt +0 -309
- package/src/lib/win32/poppler-22.04.0/share/poppler/Makefile +0 -333
|
@@ -1,734 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// Form.h
|
|
4
|
-
//
|
|
5
|
-
// This file is licensed under the GPLv2 or later
|
|
6
|
-
//
|
|
7
|
-
// Copyright 2006 Julien Rebetez <julienr@svn.gnome.org>
|
|
8
|
-
// Copyright 2007, 2008, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
|
|
9
|
-
// Copyright 2007-2010, 2012, 2015-2022 Albert Astals Cid <aacid@kde.org>
|
|
10
|
-
// Copyright 2010 Mark Riedesel <mark@klowner.com>
|
|
11
|
-
// Copyright 2011 Pino Toscano <pino@kde.org>
|
|
12
|
-
// Copyright 2012 Fabio D'Urso <fabiodurso@hotmail.it>
|
|
13
|
-
// Copyright 2013 Adrian Johnson <ajohnson@redneon.com>
|
|
14
|
-
// Copyright 2015 André Guerreiro <aguerreiro1985@gmail.com>
|
|
15
|
-
// Copyright 2015 André Esser <bepandre@hotmail.com>
|
|
16
|
-
// Copyright 2017 Roland Hieber <r.hieber@pengutronix.de>
|
|
17
|
-
// Copyright 2017 Hans-Ulrich Jüttner <huj@froreich-bioscientia.de>
|
|
18
|
-
// Copyright 2018 Andre Heinecke <aheinecke@intevation.de>
|
|
19
|
-
// Copyright 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
|
|
20
|
-
// Copyright 2018 Chinmoy Ranjan Pradhan <chinmoyrp65@protonmail.com>
|
|
21
|
-
// Copyright 2019, 2020 Oliver Sander <oliver.sander@tu-dresden.de>
|
|
22
|
-
// Copyright 2019 João Netto <joaonetto901@gmail.com>
|
|
23
|
-
// Copyright 2020, 2021 Nelson Benítez León <nbenitezl@gmail.com>
|
|
24
|
-
// Copyright 2020 Marek Kasik <mkasik@redhat.com>
|
|
25
|
-
// Copyright 2020 Thorsten Behrens <Thorsten.Behrens@CIB.de>
|
|
26
|
-
// Copyright 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
|
|
27
|
-
// Copyright 2021 Georgiy Sgibnev <georgiy@sgibnev.com>. Work sponsored by lab50.net.
|
|
28
|
-
// Copyright 2021 Theofilos Intzoglou <int.teo@gmail.com>
|
|
29
|
-
//
|
|
30
|
-
//========================================================================
|
|
31
|
-
|
|
32
|
-
#ifndef FORM_H
|
|
33
|
-
#define FORM_H
|
|
34
|
-
|
|
35
|
-
#include "Object.h"
|
|
36
|
-
#include "Annot.h"
|
|
37
|
-
#include "poppler_private_export.h"
|
|
38
|
-
|
|
39
|
-
#include <ctime>
|
|
40
|
-
|
|
41
|
-
#include <optional>
|
|
42
|
-
#include <set>
|
|
43
|
-
#include <vector>
|
|
44
|
-
|
|
45
|
-
class GooString;
|
|
46
|
-
class Array;
|
|
47
|
-
class Dict;
|
|
48
|
-
class Annot;
|
|
49
|
-
class AnnotWidget;
|
|
50
|
-
class Annots;
|
|
51
|
-
class LinkAction;
|
|
52
|
-
class GfxResources;
|
|
53
|
-
class PDFDoc;
|
|
54
|
-
class SignatureInfo;
|
|
55
|
-
class X509CertificateInfo;
|
|
56
|
-
class SignatureHandler;
|
|
57
|
-
|
|
58
|
-
enum FormFieldType
|
|
59
|
-
{
|
|
60
|
-
formButton,
|
|
61
|
-
formText,
|
|
62
|
-
formChoice,
|
|
63
|
-
formSignature,
|
|
64
|
-
formUndef
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
enum FormButtonType
|
|
68
|
-
{
|
|
69
|
-
formButtonCheck,
|
|
70
|
-
formButtonPush,
|
|
71
|
-
formButtonRadio
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
enum FormSignatureType
|
|
75
|
-
{
|
|
76
|
-
adbe_pkcs7_sha1,
|
|
77
|
-
adbe_pkcs7_detached,
|
|
78
|
-
ETSI_CAdES_detached,
|
|
79
|
-
unknown_signature_type,
|
|
80
|
-
unsigned_signature_field
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
enum FillValueType
|
|
84
|
-
{
|
|
85
|
-
fillValue,
|
|
86
|
-
fillDefaultValue
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
class Form;
|
|
90
|
-
class FormField;
|
|
91
|
-
class FormFieldButton;
|
|
92
|
-
class FormFieldText;
|
|
93
|
-
class FormFieldSignature;
|
|
94
|
-
class FormFieldChoice;
|
|
95
|
-
|
|
96
|
-
//------------------------------------------------------------------------
|
|
97
|
-
// FormWidget
|
|
98
|
-
// A FormWidget represents the graphical part of a field and is "attached"
|
|
99
|
-
// to a page.
|
|
100
|
-
//------------------------------------------------------------------------
|
|
101
|
-
|
|
102
|
-
class POPPLER_PRIVATE_EXPORT FormWidget
|
|
103
|
-
{
|
|
104
|
-
public:
|
|
105
|
-
virtual ~FormWidget();
|
|
106
|
-
|
|
107
|
-
// Check if point is inside the field bounding rect
|
|
108
|
-
bool inRect(double x, double y) const;
|
|
109
|
-
|
|
110
|
-
// Get the field bounding rect
|
|
111
|
-
void getRect(double *x1, double *y1, double *x2, double *y2) const;
|
|
112
|
-
|
|
113
|
-
unsigned getID() { return ID; }
|
|
114
|
-
void setID(unsigned int i) { ID = i; }
|
|
115
|
-
|
|
116
|
-
FormField *getField() { return field; }
|
|
117
|
-
FormFieldType getType() { return type; }
|
|
118
|
-
|
|
119
|
-
Object *getObj() { return &obj; }
|
|
120
|
-
Ref getRef() { return ref; }
|
|
121
|
-
|
|
122
|
-
void setChildNum(unsigned i) { childNum = i; }
|
|
123
|
-
unsigned getChildNum() { return childNum; }
|
|
124
|
-
|
|
125
|
-
const GooString *getPartialName() const;
|
|
126
|
-
void setPartialName(const GooString &name);
|
|
127
|
-
const GooString *getAlternateUiName() const;
|
|
128
|
-
const GooString *getMappingName() const;
|
|
129
|
-
GooString *getFullyQualifiedName();
|
|
130
|
-
|
|
131
|
-
bool isModified() const;
|
|
132
|
-
|
|
133
|
-
bool isReadOnly() const;
|
|
134
|
-
void setReadOnly(bool value);
|
|
135
|
-
|
|
136
|
-
LinkAction *getActivationAction(); // The caller should not delete the result
|
|
137
|
-
std::unique_ptr<LinkAction> getAdditionalAction(Annot::FormAdditionalActionsType type);
|
|
138
|
-
bool setAdditionalAction(Annot::FormAdditionalActionsType t, const GooString &js);
|
|
139
|
-
|
|
140
|
-
// return the unique ID corresponding to pageNum/fieldNum
|
|
141
|
-
static int encodeID(unsigned pageNum, unsigned fieldNum);
|
|
142
|
-
// decode id and retrieve pageNum and fieldNum
|
|
143
|
-
static void decodeID(unsigned id, unsigned *pageNum, unsigned *fieldNum);
|
|
144
|
-
|
|
145
|
-
void createWidgetAnnotation();
|
|
146
|
-
AnnotWidget *getWidgetAnnotation() const { return widget; }
|
|
147
|
-
void setWidgetAnnotation(AnnotWidget *_widget) { widget = _widget; }
|
|
148
|
-
|
|
149
|
-
virtual void updateWidgetAppearance() = 0;
|
|
150
|
-
|
|
151
|
-
void print(int indent = 0);
|
|
152
|
-
|
|
153
|
-
protected:
|
|
154
|
-
FormWidget(PDFDoc *docA, Object *aobj, unsigned num, Ref aref, FormField *fieldA);
|
|
155
|
-
|
|
156
|
-
AnnotWidget *widget;
|
|
157
|
-
FormField *field;
|
|
158
|
-
FormFieldType type;
|
|
159
|
-
Object obj;
|
|
160
|
-
Ref ref;
|
|
161
|
-
PDFDoc *doc;
|
|
162
|
-
XRef *xref;
|
|
163
|
-
|
|
164
|
-
// index of this field in the parent's child list
|
|
165
|
-
unsigned childNum;
|
|
166
|
-
|
|
167
|
-
/*
|
|
168
|
-
Field ID is an (unsigned) integer, calculated as follow :
|
|
169
|
-
the first sizeof/2 bits are the field number, relative to the page
|
|
170
|
-
the last sizeof/2 bits are the page number
|
|
171
|
-
[page number | field number]
|
|
172
|
-
(encoding) id = (pageNum << 4*sizeof(unsigned)) + fieldNum;
|
|
173
|
-
(decoding) pageNum = id >> 4*sizeof(unsigned); fieldNum = (id << 4*sizeof(unsigned)) >> 4*sizeof(unsigned);
|
|
174
|
-
*/
|
|
175
|
-
unsigned ID;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
//------------------------------------------------------------------------
|
|
179
|
-
// FormWidgetButton
|
|
180
|
-
//------------------------------------------------------------------------
|
|
181
|
-
|
|
182
|
-
class POPPLER_PRIVATE_EXPORT FormWidgetButton : public FormWidget
|
|
183
|
-
{
|
|
184
|
-
public:
|
|
185
|
-
FormWidgetButton(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p);
|
|
186
|
-
~FormWidgetButton() override;
|
|
187
|
-
|
|
188
|
-
FormButtonType getButtonType() const;
|
|
189
|
-
|
|
190
|
-
void setState(bool state);
|
|
191
|
-
bool getState() const;
|
|
192
|
-
|
|
193
|
-
const char *getOnStr() const;
|
|
194
|
-
void setAppearanceState(const char *state);
|
|
195
|
-
void updateWidgetAppearance() override;
|
|
196
|
-
|
|
197
|
-
protected:
|
|
198
|
-
FormFieldButton *parent() const;
|
|
199
|
-
GooString *onStr;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
//------------------------------------------------------------------------
|
|
203
|
-
// FormWidgetText
|
|
204
|
-
//------------------------------------------------------------------------
|
|
205
|
-
|
|
206
|
-
class POPPLER_PRIVATE_EXPORT FormWidgetText : public FormWidget
|
|
207
|
-
{
|
|
208
|
-
public:
|
|
209
|
-
FormWidgetText(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p);
|
|
210
|
-
// return the field's content (UTF16BE)
|
|
211
|
-
const GooString *getContent() const;
|
|
212
|
-
|
|
213
|
-
// expects a UTF16BE string
|
|
214
|
-
void setContent(const GooString *new_content);
|
|
215
|
-
// sets the text inside the field appearance stream
|
|
216
|
-
void setAppearanceContent(const GooString *new_content);
|
|
217
|
-
|
|
218
|
-
void updateWidgetAppearance() override;
|
|
219
|
-
|
|
220
|
-
bool isMultiline() const;
|
|
221
|
-
bool isPassword() const;
|
|
222
|
-
bool isFileSelect() const;
|
|
223
|
-
bool noSpellCheck() const;
|
|
224
|
-
bool noScroll() const;
|
|
225
|
-
bool isComb() const;
|
|
226
|
-
bool isRichText() const;
|
|
227
|
-
int getMaxLen() const;
|
|
228
|
-
// return the font size of the field's text
|
|
229
|
-
double getTextFontSize();
|
|
230
|
-
// set the font size of the field's text (currently only integer values)
|
|
231
|
-
void setTextFontSize(int fontSize);
|
|
232
|
-
|
|
233
|
-
protected:
|
|
234
|
-
FormFieldText *parent() const;
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
//------------------------------------------------------------------------
|
|
238
|
-
// FormWidgetChoice
|
|
239
|
-
//------------------------------------------------------------------------
|
|
240
|
-
|
|
241
|
-
class POPPLER_PRIVATE_EXPORT FormWidgetChoice : public FormWidget
|
|
242
|
-
{
|
|
243
|
-
public:
|
|
244
|
-
FormWidgetChoice(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p);
|
|
245
|
-
~FormWidgetChoice() override;
|
|
246
|
-
|
|
247
|
-
int getNumChoices() const;
|
|
248
|
-
// return the display name of the i-th choice (UTF16BE)
|
|
249
|
-
const GooString *getChoice(int i) const;
|
|
250
|
-
const GooString *getExportVal(int i) const;
|
|
251
|
-
// select the i-th choice
|
|
252
|
-
void select(int i);
|
|
253
|
-
|
|
254
|
-
// toggle selection of the i-th choice
|
|
255
|
-
void toggle(int i);
|
|
256
|
-
|
|
257
|
-
// deselect everything
|
|
258
|
-
void deselectAll();
|
|
259
|
-
|
|
260
|
-
// except a UTF16BE string
|
|
261
|
-
// only work for editable combo box, set the user-entered text as the current choice
|
|
262
|
-
void setEditChoice(const GooString *new_content);
|
|
263
|
-
|
|
264
|
-
const GooString *getEditChoice() const;
|
|
265
|
-
|
|
266
|
-
void updateWidgetAppearance() override;
|
|
267
|
-
bool isSelected(int i) const;
|
|
268
|
-
|
|
269
|
-
bool isCombo() const;
|
|
270
|
-
bool hasEdit() const;
|
|
271
|
-
bool isMultiSelect() const;
|
|
272
|
-
bool noSpellCheck() const;
|
|
273
|
-
bool commitOnSelChange() const;
|
|
274
|
-
bool isListBox() const;
|
|
275
|
-
|
|
276
|
-
protected:
|
|
277
|
-
bool _checkRange(int i) const;
|
|
278
|
-
FormFieldChoice *parent() const;
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
//------------------------------------------------------------------------
|
|
282
|
-
// FormWidgetSignature
|
|
283
|
-
//------------------------------------------------------------------------
|
|
284
|
-
|
|
285
|
-
class POPPLER_PRIVATE_EXPORT FormWidgetSignature : public FormWidget
|
|
286
|
-
{
|
|
287
|
-
public:
|
|
288
|
-
FormWidgetSignature(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p);
|
|
289
|
-
void updateWidgetAppearance() override;
|
|
290
|
-
|
|
291
|
-
FormSignatureType signatureType() const;
|
|
292
|
-
void setSignatureType(FormSignatureType fst);
|
|
293
|
-
|
|
294
|
-
// Use -1 for now as validationTime
|
|
295
|
-
SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime, bool ocspRevocationCheck, bool enableAIA);
|
|
296
|
-
|
|
297
|
-
// returns a list with the boundaries of the signed ranges
|
|
298
|
-
// the elements of the list are of type Goffset
|
|
299
|
-
std::vector<Goffset> getSignedRangeBounds() const;
|
|
300
|
-
|
|
301
|
-
// Creates or replaces the dictionary name "V" in the signature dictionary and
|
|
302
|
-
// fills it with the fields of the signature; the field "Contents" is the signature
|
|
303
|
-
// in PKCS#7 format, which is calculated over the byte range encompassing the whole
|
|
304
|
-
// document except for the signature itself; this byte range is specified in the
|
|
305
|
-
// field "ByteRange" in the dictionary "V".
|
|
306
|
-
// Arguments reason and location are UTF-16 big endian strings with BOM. An empty string and nullptr are acceptable too.
|
|
307
|
-
// Returns success.
|
|
308
|
-
bool signDocument(const char *filename, const char *certNickname, const char *digestName, const char *password, const GooString *reason = nullptr, const GooString *location = nullptr, const std::optional<GooString> &ownerPassword = {},
|
|
309
|
-
const std::optional<GooString> &userPassword = {});
|
|
310
|
-
|
|
311
|
-
// Same as above but adds text, font color, etc.
|
|
312
|
-
bool signDocumentWithAppearance(const char *filename, const char *certNickname, const char *digestName, const char *password, const GooString *reason = nullptr, const GooString *location = nullptr,
|
|
313
|
-
const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, const GooString &signatureText = {}, const GooString &signatureTextLeft = {}, double fontSize = {},
|
|
314
|
-
std::unique_ptr<AnnotColor> &&fontColor = {}, double borderWidth = {}, std::unique_ptr<AnnotColor> &&borderColor = {}, std::unique_ptr<AnnotColor> &&backgroundColor = {});
|
|
315
|
-
|
|
316
|
-
// checks the length encoding of the signature and returns the hex encoded signature
|
|
317
|
-
// if the check passed (and the checked file size as output parameter in checkedFileSize)
|
|
318
|
-
// otherwise a nullptr is returned
|
|
319
|
-
std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize);
|
|
320
|
-
|
|
321
|
-
const GooString *getSignature() const;
|
|
322
|
-
|
|
323
|
-
private:
|
|
324
|
-
bool createSignature(Object &vObj, Ref vRef, const GooString &name, const GooString *signature, const GooString *reason = nullptr, const GooString *location = nullptr);
|
|
325
|
-
bool getObjectStartEnd(const GooString &filename, int objNum, Goffset *objStart, Goffset *objEnd, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword);
|
|
326
|
-
bool updateOffsets(FILE *f, Goffset objStart, Goffset objEnd, Goffset *sigStart, Goffset *sigEnd, Goffset *fileSize);
|
|
327
|
-
|
|
328
|
-
bool updateSignature(FILE *f, Goffset sigStart, Goffset sigEnd, const GooString *signature);
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
//------------------------------------------------------------------------
|
|
332
|
-
// FormField
|
|
333
|
-
// A FormField implements the logical side of a field and is "attached" to
|
|
334
|
-
// the Catalog. This is an internal class and client applications should
|
|
335
|
-
// only interact with FormWidgets.
|
|
336
|
-
//------------------------------------------------------------------------
|
|
337
|
-
|
|
338
|
-
class FormField
|
|
339
|
-
{
|
|
340
|
-
public:
|
|
341
|
-
FormField(PDFDoc *docA, Object &&aobj, const Ref aref, FormField *parent, std::set<int> *usedParents, FormFieldType t = formUndef);
|
|
342
|
-
|
|
343
|
-
virtual ~FormField();
|
|
344
|
-
|
|
345
|
-
// Accessors.
|
|
346
|
-
FormFieldType getType() const { return type; }
|
|
347
|
-
Object *getObj() { return &obj; }
|
|
348
|
-
Ref getRef() { return ref; }
|
|
349
|
-
|
|
350
|
-
void setReadOnly(bool value);
|
|
351
|
-
bool isReadOnly() const { return readOnly; }
|
|
352
|
-
void setStandAlone(bool value) { standAlone = value; }
|
|
353
|
-
bool isStandAlone() const { return standAlone; }
|
|
354
|
-
|
|
355
|
-
GooString *getDefaultAppearance() const { return defaultAppearance; }
|
|
356
|
-
void setDefaultAppearance(const std::string &appearance);
|
|
357
|
-
|
|
358
|
-
bool hasTextQuadding() const { return hasQuadding; }
|
|
359
|
-
VariableTextQuadding getTextQuadding() const { return quadding; }
|
|
360
|
-
|
|
361
|
-
const GooString *getPartialName() const { return partialName; }
|
|
362
|
-
void setPartialName(const GooString &name);
|
|
363
|
-
const GooString *getAlternateUiName() const { return alternateUiName; }
|
|
364
|
-
const GooString *getMappingName() const { return mappingName; }
|
|
365
|
-
GooString *getFullyQualifiedName();
|
|
366
|
-
|
|
367
|
-
FormWidget *findWidgetByRef(Ref aref);
|
|
368
|
-
int getNumWidgets() const { return terminal ? numChildren : 0; }
|
|
369
|
-
FormWidget *getWidget(int i) const { return terminal ? widgets[i] : nullptr; }
|
|
370
|
-
int getNumChildren() const { return !terminal ? numChildren : 0; }
|
|
371
|
-
FormField *getChildren(int i) const { return children[i]; }
|
|
372
|
-
|
|
373
|
-
// only implemented in FormFieldButton
|
|
374
|
-
virtual void fillChildrenSiblingsID();
|
|
375
|
-
|
|
376
|
-
void createWidgetAnnotations();
|
|
377
|
-
|
|
378
|
-
void printTree(int indent = 0);
|
|
379
|
-
virtual void print(int indent = 0);
|
|
380
|
-
virtual void reset(const std::vector<std::string> &excludedFields);
|
|
381
|
-
void resetChildren(const std::vector<std::string> &excludedFields);
|
|
382
|
-
FormField *findFieldByRef(Ref aref);
|
|
383
|
-
FormField *findFieldByFullyQualifiedName(const std::string &name);
|
|
384
|
-
|
|
385
|
-
protected:
|
|
386
|
-
void _createWidget(Object *obj, Ref aref);
|
|
387
|
-
void createChildren(std::set<int> *usedParents);
|
|
388
|
-
void updateChildrenAppearance();
|
|
389
|
-
bool isAmongExcludedFields(const std::vector<std::string> &excludedFields);
|
|
390
|
-
|
|
391
|
-
FormFieldType type; // field type
|
|
392
|
-
Ref ref;
|
|
393
|
-
bool terminal;
|
|
394
|
-
Object obj;
|
|
395
|
-
PDFDoc *doc;
|
|
396
|
-
XRef *xref;
|
|
397
|
-
FormField **children;
|
|
398
|
-
FormField *parent;
|
|
399
|
-
int numChildren;
|
|
400
|
-
FormWidget **widgets;
|
|
401
|
-
bool readOnly;
|
|
402
|
-
|
|
403
|
-
GooString *partialName; // T field
|
|
404
|
-
GooString *alternateUiName; // TU field
|
|
405
|
-
GooString *mappingName; // TM field
|
|
406
|
-
GooString *fullyQualifiedName;
|
|
407
|
-
|
|
408
|
-
// Variable Text
|
|
409
|
-
GooString *defaultAppearance;
|
|
410
|
-
bool hasQuadding;
|
|
411
|
-
VariableTextQuadding quadding;
|
|
412
|
-
|
|
413
|
-
// True when FormField is not part of Catalog's Field array (or there isn't one).
|
|
414
|
-
bool standAlone;
|
|
415
|
-
|
|
416
|
-
private:
|
|
417
|
-
FormField() { }
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
//------------------------------------------------------------------------
|
|
421
|
-
// FormFieldButton
|
|
422
|
-
//------------------------------------------------------------------------
|
|
423
|
-
|
|
424
|
-
class FormFieldButton : public FormField
|
|
425
|
-
{
|
|
426
|
-
public:
|
|
427
|
-
FormFieldButton(PDFDoc *docA, Object &&dict, const Ref ref, FormField *parent, std::set<int> *usedParents);
|
|
428
|
-
|
|
429
|
-
FormButtonType getButtonType() const { return btype; }
|
|
430
|
-
|
|
431
|
-
bool noToggleToOff() const { return noAllOff; }
|
|
432
|
-
|
|
433
|
-
// returns true if the state modification is accepted
|
|
434
|
-
bool setState(const char *state, bool ignoreToggleOff = false);
|
|
435
|
-
bool getState(const char *state) const;
|
|
436
|
-
|
|
437
|
-
const char *getAppearanceState() const { return appearanceState.isName() ? appearanceState.getName() : nullptr; }
|
|
438
|
-
const char *getDefaultAppearanceState() const { return defaultAppearanceState.isName() ? defaultAppearanceState.getName() : nullptr; }
|
|
439
|
-
|
|
440
|
-
void fillChildrenSiblingsID() override;
|
|
441
|
-
|
|
442
|
-
void setNumSiblings(int num);
|
|
443
|
-
void setSibling(int i, FormFieldButton *id) { siblings[i] = id; }
|
|
444
|
-
|
|
445
|
-
// For radio buttons, return the fields of the other radio buttons in the same group
|
|
446
|
-
FormFieldButton *getSibling(int i) const { return siblings[i]; }
|
|
447
|
-
int getNumSiblings() const { return numSiblings; }
|
|
448
|
-
|
|
449
|
-
void print(int indent) override;
|
|
450
|
-
void reset(const std::vector<std::string> &excludedFields) override;
|
|
451
|
-
|
|
452
|
-
~FormFieldButton() override;
|
|
453
|
-
|
|
454
|
-
protected:
|
|
455
|
-
void updateState(const char *state);
|
|
456
|
-
|
|
457
|
-
FormFieldButton **siblings; // IDs of dependent buttons (each button of a radio field has all the others buttons
|
|
458
|
-
// of the same field in this array)
|
|
459
|
-
int numSiblings;
|
|
460
|
-
|
|
461
|
-
FormButtonType btype;
|
|
462
|
-
int size;
|
|
463
|
-
int active_child; // only used for combo box
|
|
464
|
-
bool noAllOff;
|
|
465
|
-
Object appearanceState; // V
|
|
466
|
-
Object defaultAppearanceState; // DV
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
//------------------------------------------------------------------------
|
|
470
|
-
// FormFieldText
|
|
471
|
-
//------------------------------------------------------------------------
|
|
472
|
-
|
|
473
|
-
class FormFieldText : public FormField
|
|
474
|
-
{
|
|
475
|
-
public:
|
|
476
|
-
FormFieldText(PDFDoc *docA, Object &&dictObj, const Ref ref, FormField *parent, std::set<int> *usedParents);
|
|
477
|
-
|
|
478
|
-
const GooString *getContent() const { return content; }
|
|
479
|
-
const GooString *getAppearanceContent() const { return internalContent ? internalContent : content; }
|
|
480
|
-
void setContentCopy(const GooString *new_content);
|
|
481
|
-
void setAppearanceContentCopy(const GooString *new_content);
|
|
482
|
-
~FormFieldText() override;
|
|
483
|
-
|
|
484
|
-
bool isMultiline() const { return multiline; }
|
|
485
|
-
bool isPassword() const { return password; }
|
|
486
|
-
bool isFileSelect() const { return fileSelect; }
|
|
487
|
-
bool noSpellCheck() const { return doNotSpellCheck; }
|
|
488
|
-
bool noScroll() const { return doNotScroll; }
|
|
489
|
-
bool isComb() const { return comb; }
|
|
490
|
-
bool isRichText() const { return richText; }
|
|
491
|
-
|
|
492
|
-
int getMaxLen() const { return maxLen; }
|
|
493
|
-
|
|
494
|
-
// return the font size of the field's text
|
|
495
|
-
double getTextFontSize();
|
|
496
|
-
// set the font size of the field's text (currently only integer values)
|
|
497
|
-
void setTextFontSize(int fontSize);
|
|
498
|
-
|
|
499
|
-
void print(int indent) override;
|
|
500
|
-
void reset(const std::vector<std::string> &excludedFields) override;
|
|
501
|
-
|
|
502
|
-
static int tokenizeDA(const std::string &daString, std::vector<std::string> *daToks, const char *searchTok);
|
|
503
|
-
|
|
504
|
-
protected:
|
|
505
|
-
int parseDA(std::vector<std::string> *daToks);
|
|
506
|
-
void fillContent(FillValueType fillType);
|
|
507
|
-
|
|
508
|
-
GooString *content;
|
|
509
|
-
GooString *internalContent;
|
|
510
|
-
GooString *defaultContent;
|
|
511
|
-
bool multiline;
|
|
512
|
-
bool password;
|
|
513
|
-
bool fileSelect;
|
|
514
|
-
bool doNotSpellCheck;
|
|
515
|
-
bool doNotScroll;
|
|
516
|
-
bool comb;
|
|
517
|
-
bool richText;
|
|
518
|
-
int maxLen;
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
//------------------------------------------------------------------------
|
|
522
|
-
// FormFieldChoice
|
|
523
|
-
//------------------------------------------------------------------------
|
|
524
|
-
|
|
525
|
-
class FormFieldChoice : public FormField
|
|
526
|
-
{
|
|
527
|
-
public:
|
|
528
|
-
FormFieldChoice(PDFDoc *docA, Object &&aobj, const Ref ref, FormField *parent, std::set<int> *usedParents);
|
|
529
|
-
|
|
530
|
-
~FormFieldChoice() override;
|
|
531
|
-
|
|
532
|
-
int getNumChoices() const { return numChoices; }
|
|
533
|
-
const GooString *getChoice(int i) const { return choices ? choices[i].optionName : nullptr; }
|
|
534
|
-
const GooString *getExportVal(int i) const { return choices ? choices[i].exportVal : nullptr; }
|
|
535
|
-
// For multi-select choices it returns the first one
|
|
536
|
-
const GooString *getSelectedChoice() const;
|
|
537
|
-
|
|
538
|
-
// select the i-th choice
|
|
539
|
-
void select(int i);
|
|
540
|
-
|
|
541
|
-
// toggle selection of the i-th choice
|
|
542
|
-
void toggle(int i);
|
|
543
|
-
|
|
544
|
-
// deselect everything
|
|
545
|
-
void deselectAll();
|
|
546
|
-
|
|
547
|
-
// only work for editable combo box, set the user-entered text as the current choice
|
|
548
|
-
void setEditChoice(const GooString *new_content);
|
|
549
|
-
|
|
550
|
-
const GooString *getEditChoice() const;
|
|
551
|
-
|
|
552
|
-
bool isSelected(int i) const { return choices[i].selected; }
|
|
553
|
-
|
|
554
|
-
int getNumSelected();
|
|
555
|
-
|
|
556
|
-
bool isCombo() const { return combo; }
|
|
557
|
-
bool hasEdit() const { return edit; }
|
|
558
|
-
bool isMultiSelect() const { return multiselect; }
|
|
559
|
-
bool noSpellCheck() const { return doNotSpellCheck; }
|
|
560
|
-
bool commitOnSelChange() const { return doCommitOnSelChange; }
|
|
561
|
-
bool isListBox() const { return !combo; }
|
|
562
|
-
|
|
563
|
-
int getTopIndex() const { return topIdx; }
|
|
564
|
-
|
|
565
|
-
void print(int indent) override;
|
|
566
|
-
void reset(const std::vector<std::string> &excludedFields) override;
|
|
567
|
-
|
|
568
|
-
protected:
|
|
569
|
-
void unselectAll();
|
|
570
|
-
void updateSelection();
|
|
571
|
-
void fillChoices(FillValueType fillType);
|
|
572
|
-
|
|
573
|
-
bool combo;
|
|
574
|
-
bool edit;
|
|
575
|
-
bool multiselect;
|
|
576
|
-
bool doNotSpellCheck;
|
|
577
|
-
bool doCommitOnSelChange;
|
|
578
|
-
|
|
579
|
-
struct ChoiceOpt
|
|
580
|
-
{
|
|
581
|
-
GooString *exportVal; // the export value ("internal" name)
|
|
582
|
-
GooString *optionName; // displayed name
|
|
583
|
-
bool selected; // if this choice is selected
|
|
584
|
-
};
|
|
585
|
-
|
|
586
|
-
int numChoices;
|
|
587
|
-
ChoiceOpt *choices;
|
|
588
|
-
bool *defaultChoices;
|
|
589
|
-
GooString *editedChoice;
|
|
590
|
-
int topIdx; // TI
|
|
591
|
-
};
|
|
592
|
-
|
|
593
|
-
//------------------------------------------------------------------------
|
|
594
|
-
// FormFieldSignature
|
|
595
|
-
//------------------------------------------------------------------------
|
|
596
|
-
|
|
597
|
-
class POPPLER_PRIVATE_EXPORT FormFieldSignature : public FormField
|
|
598
|
-
{
|
|
599
|
-
public:
|
|
600
|
-
FormFieldSignature(PDFDoc *docA, Object &&dict, const Ref ref, FormField *parent, std::set<int> *usedParents);
|
|
601
|
-
|
|
602
|
-
// Use -1 for now as validationTime
|
|
603
|
-
SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime, bool ocspRevocationCheck, bool enableAIA);
|
|
604
|
-
|
|
605
|
-
// returns a list with the boundaries of the signed ranges
|
|
606
|
-
// the elements of the list are of type Goffset
|
|
607
|
-
std::vector<Goffset> getSignedRangeBounds() const;
|
|
608
|
-
|
|
609
|
-
// checks the length encoding of the signature and returns the hex encoded signature
|
|
610
|
-
// if the check passed (and the checked file size as output parameter in checkedFileSize)
|
|
611
|
-
// otherwise a nullptr is returned
|
|
612
|
-
std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize);
|
|
613
|
-
|
|
614
|
-
~FormFieldSignature() override;
|
|
615
|
-
Object *getByteRange() { return &byte_range; }
|
|
616
|
-
const GooString *getSignature() const { return signature; }
|
|
617
|
-
void setSignature(const GooString &sig);
|
|
618
|
-
FormSignatureType getSignatureType() const { return signature_type; }
|
|
619
|
-
void setSignatureType(FormSignatureType t) { signature_type = t; }
|
|
620
|
-
|
|
621
|
-
const GooString &getCustomAppearanceContent() const;
|
|
622
|
-
void setCustomAppearanceContent(const GooString &s);
|
|
623
|
-
|
|
624
|
-
const GooString &getCustomAppearanceLeftContent() const;
|
|
625
|
-
void setCustomAppearanceLeftContent(const GooString &s);
|
|
626
|
-
|
|
627
|
-
double getCustomAppearanceLeftFontSize() const;
|
|
628
|
-
void setCustomAppearanceLeftFontSize(double size);
|
|
629
|
-
|
|
630
|
-
// Background image (ref to an object of type XObject). Invalid ref if not required.
|
|
631
|
-
Ref getImageResource() const;
|
|
632
|
-
void setImageResource(const Ref imageResourceA);
|
|
633
|
-
|
|
634
|
-
void setCertificateInfo(std::unique_ptr<X509CertificateInfo> &);
|
|
635
|
-
|
|
636
|
-
FormWidget *getCreateWidget();
|
|
637
|
-
|
|
638
|
-
private:
|
|
639
|
-
void parseInfo();
|
|
640
|
-
void hashSignedDataBlock(SignatureHandler *handler, Goffset block_len);
|
|
641
|
-
|
|
642
|
-
FormSignatureType signature_type;
|
|
643
|
-
Object byte_range;
|
|
644
|
-
GooString *signature;
|
|
645
|
-
SignatureInfo *signature_info;
|
|
646
|
-
GooString customAppearanceContent;
|
|
647
|
-
GooString customAppearanceLeftContent;
|
|
648
|
-
double customAppearanceLeftFontSize = 20;
|
|
649
|
-
Ref imageResource = Ref::INVALID();
|
|
650
|
-
std::unique_ptr<X509CertificateInfo> certificate_info;
|
|
651
|
-
|
|
652
|
-
void print(int indent) override;
|
|
653
|
-
};
|
|
654
|
-
|
|
655
|
-
//------------------------------------------------------------------------
|
|
656
|
-
// Form
|
|
657
|
-
// This class handle the document-wide part of Form (things in the acroForm
|
|
658
|
-
// Catalog entry).
|
|
659
|
-
//------------------------------------------------------------------------
|
|
660
|
-
|
|
661
|
-
class POPPLER_PRIVATE_EXPORT Form
|
|
662
|
-
{
|
|
663
|
-
public:
|
|
664
|
-
explicit Form(PDFDoc *doc);
|
|
665
|
-
|
|
666
|
-
~Form();
|
|
667
|
-
|
|
668
|
-
Form(const Form &) = delete;
|
|
669
|
-
Form &operator=(const Form &) = delete;
|
|
670
|
-
|
|
671
|
-
// Look up an inheritable field dictionary entry.
|
|
672
|
-
static Object fieldLookup(Dict *field, const char *key);
|
|
673
|
-
|
|
674
|
-
/* Creates a new Field of the type specified in obj's dict.
|
|
675
|
-
used in Form::Form , FormField::FormField and
|
|
676
|
-
Page::loadStandaloneFields */
|
|
677
|
-
static FormField *createFieldFromDict(Object &&obj, PDFDoc *docA, const Ref aref, FormField *parent, std::set<int> *usedParents);
|
|
678
|
-
|
|
679
|
-
bool getNeedAppearances() const { return needAppearances; }
|
|
680
|
-
int getNumFields() const { return numFields; }
|
|
681
|
-
FormField *getRootField(int i) const { return rootFields[i]; }
|
|
682
|
-
const GooString *getDefaultAppearance() const { return defaultAppearance; }
|
|
683
|
-
VariableTextQuadding getTextQuadding() const { return quadding; }
|
|
684
|
-
GfxResources *getDefaultResources() const { return defaultResources; }
|
|
685
|
-
Object *getDefaultResourcesObj() { return &resDict; }
|
|
686
|
-
|
|
687
|
-
FormWidget *findWidgetByRef(Ref aref);
|
|
688
|
-
FormField *findFieldByRef(Ref aref) const;
|
|
689
|
-
FormField *findFieldByFullyQualifiedName(const std::string &name) const;
|
|
690
|
-
|
|
691
|
-
void postWidgetsLoad();
|
|
692
|
-
|
|
693
|
-
const std::vector<Ref> &getCalculateOrder() const { return calculateOrder; }
|
|
694
|
-
|
|
695
|
-
void reset(const std::vector<std::string> &fields, bool excludeFields);
|
|
696
|
-
|
|
697
|
-
private:
|
|
698
|
-
FormField **rootFields;
|
|
699
|
-
int numFields;
|
|
700
|
-
int size;
|
|
701
|
-
bool needAppearances;
|
|
702
|
-
GfxResources *defaultResources;
|
|
703
|
-
Object resDict;
|
|
704
|
-
std::vector<Ref> calculateOrder;
|
|
705
|
-
|
|
706
|
-
// Variable Text
|
|
707
|
-
GooString *defaultAppearance;
|
|
708
|
-
VariableTextQuadding quadding;
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
//------------------------------------------------------------------------
|
|
712
|
-
// FormPageWidgets
|
|
713
|
-
//------------------------------------------------------------------------
|
|
714
|
-
|
|
715
|
-
class POPPLER_PRIVATE_EXPORT FormPageWidgets
|
|
716
|
-
{
|
|
717
|
-
public:
|
|
718
|
-
FormPageWidgets(Annots *annots, unsigned int page, Form *form);
|
|
719
|
-
~FormPageWidgets();
|
|
720
|
-
|
|
721
|
-
FormPageWidgets(const FormPageWidgets &) = delete;
|
|
722
|
-
FormPageWidgets &operator=(const FormPageWidgets &) = delete;
|
|
723
|
-
|
|
724
|
-
int getNumWidgets() const { return numWidgets; }
|
|
725
|
-
FormWidget *getWidget(int i) const { return widgets[i]; }
|
|
726
|
-
void addWidgets(const std::vector<FormField *> &addedWidgets, unsigned int page);
|
|
727
|
-
|
|
728
|
-
private:
|
|
729
|
-
FormWidget **widgets;
|
|
730
|
-
int numWidgets;
|
|
731
|
-
int size;
|
|
732
|
-
};
|
|
733
|
-
|
|
734
|
-
#endif
|