node-poppler 5.1.4 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +13 -13
- package/src/index.js +20 -8
- package/API.md +0 -465
- package/CHANGELOG.md +0 -976
- 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
- package/tsconfig.json +0 -9
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// Page.h
|
|
4
|
-
//
|
|
5
|
-
// Copyright 1996-2003 Glyph & Cog, LLC
|
|
6
|
-
//
|
|
7
|
-
//========================================================================
|
|
8
|
-
|
|
9
|
-
//========================================================================
|
|
10
|
-
//
|
|
11
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
12
|
-
//
|
|
13
|
-
// All changes made under the Poppler project to this file are licensed
|
|
14
|
-
// under GPL version 2 or later
|
|
15
|
-
//
|
|
16
|
-
// Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
|
|
17
|
-
// Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net>
|
|
18
|
-
// Copyright (C) 2006 Pino Toscano <pino@kde.org>
|
|
19
|
-
// Copyright (C) 2006, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
|
|
20
|
-
// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
|
|
21
|
-
// Copyright (C) 2008 Iñigo Martínez <inigomartinez@gmail.com>
|
|
22
|
-
// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
|
|
23
|
-
// Copyright (C) 2012, 2017, 2018, 2020, 2021 Albert Astals Cid <aacid@kde.org>
|
|
24
|
-
// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
25
|
-
// Copyright (C) 2013, 2017 Adrian Johnson <ajohnson@redneon.com>
|
|
26
|
-
// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
|
|
27
|
-
// Copyright (C) 2020 Oliver Sander <oliver.sander@tu-dresden.de>
|
|
28
|
-
// Copyright (C) 2020, 2021 Nelson Benítez León <nbenitezl@gmail.com>
|
|
29
|
-
//
|
|
30
|
-
// To see a description of the changes please see the Changelog file that
|
|
31
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
32
|
-
//
|
|
33
|
-
//========================================================================
|
|
34
|
-
|
|
35
|
-
#ifndef PAGE_H
|
|
36
|
-
#define PAGE_H
|
|
37
|
-
|
|
38
|
-
#include <memory>
|
|
39
|
-
#include <mutex>
|
|
40
|
-
|
|
41
|
-
#include "poppler-config.h"
|
|
42
|
-
#include "Object.h"
|
|
43
|
-
#include "poppler_private_export.h"
|
|
44
|
-
|
|
45
|
-
class Dict;
|
|
46
|
-
class PDFDoc;
|
|
47
|
-
class XRef;
|
|
48
|
-
class OutputDev;
|
|
49
|
-
class Links;
|
|
50
|
-
class LinkAction;
|
|
51
|
-
class Annots;
|
|
52
|
-
class Annot;
|
|
53
|
-
class Gfx;
|
|
54
|
-
class FormPageWidgets;
|
|
55
|
-
class Form;
|
|
56
|
-
class FormField;
|
|
57
|
-
|
|
58
|
-
//------------------------------------------------------------------------
|
|
59
|
-
|
|
60
|
-
class PDFRectangle
|
|
61
|
-
{
|
|
62
|
-
public:
|
|
63
|
-
double x1, y1, x2, y2;
|
|
64
|
-
|
|
65
|
-
PDFRectangle() { x1 = y1 = x2 = y2 = 0; }
|
|
66
|
-
PDFRectangle(double x1A, double y1A, double x2A, double y2A)
|
|
67
|
-
{
|
|
68
|
-
x1 = x1A;
|
|
69
|
-
y1 = y1A;
|
|
70
|
-
x2 = x2A;
|
|
71
|
-
y2 = y2A;
|
|
72
|
-
}
|
|
73
|
-
bool isValid() const { return x1 != 0 || y1 != 0 || x2 != 0 || y2 != 0; }
|
|
74
|
-
bool contains(double x, double y) const { return x1 <= x && x <= x2 && y1 <= y && y <= y2; }
|
|
75
|
-
void clipTo(PDFRectangle *rect);
|
|
76
|
-
|
|
77
|
-
bool operator==(const PDFRectangle &rect) const { return x1 == rect.x1 && y1 == rect.y1 && x2 == rect.x2 && y2 == rect.y2; }
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
//------------------------------------------------------------------------
|
|
81
|
-
// PageAttrs
|
|
82
|
-
//------------------------------------------------------------------------
|
|
83
|
-
|
|
84
|
-
class PageAttrs
|
|
85
|
-
{
|
|
86
|
-
public:
|
|
87
|
-
// Construct a new PageAttrs object by merging a dictionary
|
|
88
|
-
// (of type Pages or Page) into another PageAttrs object. If
|
|
89
|
-
// <attrs> is nullptr, uses defaults.
|
|
90
|
-
PageAttrs(PageAttrs *attrs, Dict *dict);
|
|
91
|
-
|
|
92
|
-
// Destructor.
|
|
93
|
-
~PageAttrs();
|
|
94
|
-
|
|
95
|
-
// Accessors.
|
|
96
|
-
const PDFRectangle *getMediaBox() const { return &mediaBox; }
|
|
97
|
-
const PDFRectangle *getCropBox() const { return &cropBox; }
|
|
98
|
-
bool isCropped() const { return haveCropBox; }
|
|
99
|
-
const PDFRectangle *getBleedBox() const { return &bleedBox; }
|
|
100
|
-
const PDFRectangle *getTrimBox() const { return &trimBox; }
|
|
101
|
-
const PDFRectangle *getArtBox() const { return &artBox; }
|
|
102
|
-
int getRotate() const { return rotate; }
|
|
103
|
-
const GooString *getLastModified() const { return lastModified.isString() ? lastModified.getString() : nullptr; }
|
|
104
|
-
Dict *getBoxColorInfo() { return boxColorInfo.isDict() ? boxColorInfo.getDict() : nullptr; }
|
|
105
|
-
Dict *getGroup() { return group.isDict() ? group.getDict() : nullptr; }
|
|
106
|
-
Stream *getMetadata() { return metadata.isStream() ? metadata.getStream() : nullptr; }
|
|
107
|
-
Dict *getPieceInfo() { return pieceInfo.isDict() ? pieceInfo.getDict() : nullptr; }
|
|
108
|
-
Dict *getSeparationInfo() { return separationInfo.isDict() ? separationInfo.getDict() : nullptr; }
|
|
109
|
-
Dict *getResourceDict() { return resources.isDict() ? resources.getDict() : nullptr; }
|
|
110
|
-
Object *getResourceDictObject() { return &resources; }
|
|
111
|
-
void replaceResource(Object &&obj1) { resources = std::move(obj1); }
|
|
112
|
-
|
|
113
|
-
// Clip all other boxes to the MediaBox.
|
|
114
|
-
void clipBoxes();
|
|
115
|
-
|
|
116
|
-
private:
|
|
117
|
-
bool readBox(Dict *dict, const char *key, PDFRectangle *box);
|
|
118
|
-
|
|
119
|
-
PDFRectangle mediaBox;
|
|
120
|
-
PDFRectangle cropBox;
|
|
121
|
-
bool haveCropBox;
|
|
122
|
-
PDFRectangle bleedBox;
|
|
123
|
-
PDFRectangle trimBox;
|
|
124
|
-
PDFRectangle artBox;
|
|
125
|
-
int rotate;
|
|
126
|
-
Object lastModified;
|
|
127
|
-
Object boxColorInfo;
|
|
128
|
-
Object group;
|
|
129
|
-
Object metadata;
|
|
130
|
-
Object pieceInfo;
|
|
131
|
-
Object separationInfo;
|
|
132
|
-
Object resources;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
//------------------------------------------------------------------------
|
|
136
|
-
// Page
|
|
137
|
-
//------------------------------------------------------------------------
|
|
138
|
-
|
|
139
|
-
class POPPLER_PRIVATE_EXPORT Page
|
|
140
|
-
{
|
|
141
|
-
public:
|
|
142
|
-
// Constructor.
|
|
143
|
-
Page(PDFDoc *docA, int numA, Object &&pageDict, Ref pageRefA, PageAttrs *attrsA, Form *form);
|
|
144
|
-
|
|
145
|
-
// Destructor.
|
|
146
|
-
~Page();
|
|
147
|
-
|
|
148
|
-
Page(const Page &) = delete;
|
|
149
|
-
Page &operator=(const Page &) = delete;
|
|
150
|
-
|
|
151
|
-
// Is page valid?
|
|
152
|
-
bool isOk() const { return ok; }
|
|
153
|
-
|
|
154
|
-
// Get page parameters.
|
|
155
|
-
int getNum() const { return num; }
|
|
156
|
-
const PDFRectangle *getMediaBox() const { return attrs->getMediaBox(); }
|
|
157
|
-
const PDFRectangle *getCropBox() const { return attrs->getCropBox(); }
|
|
158
|
-
bool isCropped() const { return attrs->isCropped(); }
|
|
159
|
-
double getMediaWidth() const { return attrs->getMediaBox()->x2 - attrs->getMediaBox()->x1; }
|
|
160
|
-
double getMediaHeight() const { return attrs->getMediaBox()->y2 - attrs->getMediaBox()->y1; }
|
|
161
|
-
double getCropWidth() const { return attrs->getCropBox()->x2 - attrs->getCropBox()->x1; }
|
|
162
|
-
double getCropHeight() const { return attrs->getCropBox()->y2 - attrs->getCropBox()->y1; }
|
|
163
|
-
const PDFRectangle *getBleedBox() const { return attrs->getBleedBox(); }
|
|
164
|
-
const PDFRectangle *getTrimBox() const { return attrs->getTrimBox(); }
|
|
165
|
-
const PDFRectangle *getArtBox() const { return attrs->getArtBox(); }
|
|
166
|
-
int getRotate() const { return attrs->getRotate(); }
|
|
167
|
-
const GooString *getLastModified() const { return attrs->getLastModified(); }
|
|
168
|
-
Dict *getBoxColorInfo() { return attrs->getBoxColorInfo(); }
|
|
169
|
-
Dict *getGroup() { return attrs->getGroup(); }
|
|
170
|
-
Stream *getMetadata() { return attrs->getMetadata(); }
|
|
171
|
-
Dict *getPieceInfo() { return attrs->getPieceInfo(); }
|
|
172
|
-
Dict *getSeparationInfo() { return attrs->getSeparationInfo(); }
|
|
173
|
-
PDFDoc *getDoc() { return doc; }
|
|
174
|
-
Ref getRef() { return pageRef; }
|
|
175
|
-
|
|
176
|
-
// Get resource dictionary.
|
|
177
|
-
Dict *getResourceDict();
|
|
178
|
-
Object *getResourceDictObject();
|
|
179
|
-
Dict *getResourceDictCopy(XRef *xrefA);
|
|
180
|
-
|
|
181
|
-
// Get annotations array.
|
|
182
|
-
Object getAnnotsObject(XRef *xrefA = nullptr) { return annotsObj.fetch(xrefA ? xrefA : xref); }
|
|
183
|
-
// Add a new annotation to the page
|
|
184
|
-
void addAnnot(Annot *annot);
|
|
185
|
-
// Remove an existing annotation from the page
|
|
186
|
-
void removeAnnot(Annot *annot);
|
|
187
|
-
|
|
188
|
-
// Return a list of links.
|
|
189
|
-
std::unique_ptr<Links> getLinks();
|
|
190
|
-
|
|
191
|
-
// Return a list of annots. It will be valid until the page is destroyed
|
|
192
|
-
Annots *getAnnots(XRef *xrefA = nullptr);
|
|
193
|
-
|
|
194
|
-
// Get contents.
|
|
195
|
-
Object getContents() { return contents.fetch(xref); }
|
|
196
|
-
|
|
197
|
-
// Get thumb.
|
|
198
|
-
Object getThumb() { return thumb.fetch(xref); }
|
|
199
|
-
bool loadThumb(unsigned char **data, int *width, int *height, int *rowstride);
|
|
200
|
-
|
|
201
|
-
// Get transition.
|
|
202
|
-
Object getTrans() { return trans.fetch(xref); }
|
|
203
|
-
|
|
204
|
-
// Get form.
|
|
205
|
-
std::unique_ptr<FormPageWidgets> getFormWidgets();
|
|
206
|
-
|
|
207
|
-
// Get duration, the maximum length of time, in seconds,
|
|
208
|
-
// that the page is displayed before the presentation automatically
|
|
209
|
-
// advances to the next page
|
|
210
|
-
double getDuration() { return duration; }
|
|
211
|
-
|
|
212
|
-
// Get actions
|
|
213
|
-
Object getActions() { return actions.fetch(xref); }
|
|
214
|
-
|
|
215
|
-
enum PageAdditionalActionsType
|
|
216
|
-
{
|
|
217
|
-
actionOpenPage, ///< Performed when opening the page
|
|
218
|
-
actionClosePage, ///< Performed when closing the page
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
std::unique_ptr<LinkAction> getAdditionalAction(PageAdditionalActionsType type);
|
|
222
|
-
|
|
223
|
-
Gfx *createGfx(OutputDev *out, double hDPI, double vDPI, int rotate, bool useMediaBox, bool crop, int sliceX, int sliceY, int sliceW, int sliceH, bool printing, bool (*abortCheckCbk)(void *data), void *abortCheckCbkData,
|
|
224
|
-
XRef *xrefA = nullptr);
|
|
225
|
-
|
|
226
|
-
// Display a page.
|
|
227
|
-
void display(OutputDev *out, double hDPI, double vDPI, int rotate, bool useMediaBox, bool crop, bool printing, bool (*abortCheckCbk)(void *data) = nullptr, void *abortCheckCbkData = nullptr,
|
|
228
|
-
bool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = nullptr, void *annotDisplayDecideCbkData = nullptr, bool copyXRef = false);
|
|
229
|
-
|
|
230
|
-
// Display part of a page.
|
|
231
|
-
void displaySlice(OutputDev *out, double hDPI, double vDPI, int rotate, bool useMediaBox, bool crop, int sliceX, int sliceY, int sliceW, int sliceH, bool printing, bool (*abortCheckCbk)(void *data) = nullptr,
|
|
232
|
-
void *abortCheckCbkData = nullptr, bool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = nullptr, void *annotDisplayDecideCbkData = nullptr, bool copyXRef = false);
|
|
233
|
-
|
|
234
|
-
void display(Gfx *gfx);
|
|
235
|
-
|
|
236
|
-
void makeBox(double hDPI, double vDPI, int rotate, bool useMediaBox, bool upsideDown, double sliceX, double sliceY, double sliceW, double sliceH, PDFRectangle *box, bool *crop);
|
|
237
|
-
|
|
238
|
-
void processLinks(OutputDev *out);
|
|
239
|
-
|
|
240
|
-
// Get the page's default CTM.
|
|
241
|
-
void getDefaultCTM(double *ctm, double hDPI, double vDPI, int rotate, bool useMediaBox, bool upsideDown);
|
|
242
|
-
|
|
243
|
-
bool hasStandaloneFields() const { return !standaloneFields.empty(); }
|
|
244
|
-
|
|
245
|
-
private:
|
|
246
|
-
// replace xref
|
|
247
|
-
void replaceXRef(XRef *xrefA);
|
|
248
|
-
|
|
249
|
-
PDFDoc *doc;
|
|
250
|
-
XRef *xref; // the xref table for this PDF file
|
|
251
|
-
Object pageObj; // page dictionary
|
|
252
|
-
Ref pageRef; // page reference
|
|
253
|
-
int num; // page number
|
|
254
|
-
PageAttrs *attrs; // page attributes
|
|
255
|
-
Annots *annots; // annotations
|
|
256
|
-
Object annotsObj; // annotations array
|
|
257
|
-
Object contents; // page contents
|
|
258
|
-
Object thumb; // page thumbnail
|
|
259
|
-
Object trans; // page transition
|
|
260
|
-
Object actions; // page additional actions
|
|
261
|
-
double duration; // page duration
|
|
262
|
-
bool ok; // true if page is valid
|
|
263
|
-
mutable std::recursive_mutex mutex;
|
|
264
|
-
// standalone widgets are special FormWidget's inside a Page that *are not*
|
|
265
|
-
// referenced from the Catalog's Field array. That means they are standlone,
|
|
266
|
-
// i.e. the PDF document does not have a FormField associated with them. We
|
|
267
|
-
// create standalone FormFields to contain those special FormWidgets, as
|
|
268
|
-
// they are 'de facto' being used to implement tooltips. See #34
|
|
269
|
-
std::vector<FormField *> standaloneFields;
|
|
270
|
-
void loadStandaloneFields(Annots *annotations, Form *form);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
#endif
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/* PageTransition.cc
|
|
2
|
-
* Copyright (C) 2005, Net Integration Technologies, Inc.
|
|
3
|
-
* Copyright (C) 2015, Arseniy Lartsev <arseniy@alumni.chalmers.se>
|
|
4
|
-
* Copyright (C) 2019, 2021, Albert Astals Cid <aacid@kde.org>
|
|
5
|
-
*
|
|
6
|
-
* This program is free software; you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation; either version 2, or (at your option)
|
|
9
|
-
* any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program; if not, write to the Free Software
|
|
18
|
-
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
#ifndef PAGE_TRANSITION_H
|
|
22
|
-
#define PAGE_TRANSITION_H
|
|
23
|
-
|
|
24
|
-
#include "Object.h"
|
|
25
|
-
|
|
26
|
-
//------------------------------------------------------------------------
|
|
27
|
-
// PageTransition
|
|
28
|
-
//------------------------------------------------------------------------
|
|
29
|
-
|
|
30
|
-
// if changed remember to keep in sync with frontend enums
|
|
31
|
-
enum PageTransitionType
|
|
32
|
-
{
|
|
33
|
-
transitionReplace = 0,
|
|
34
|
-
transitionSplit,
|
|
35
|
-
transitionBlinds,
|
|
36
|
-
transitionBox,
|
|
37
|
-
transitionWipe,
|
|
38
|
-
transitionDissolve,
|
|
39
|
-
transitionGlitter,
|
|
40
|
-
transitionFly,
|
|
41
|
-
transitionPush,
|
|
42
|
-
transitionCover,
|
|
43
|
-
transitionUncover,
|
|
44
|
-
transitionFade
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// if changed remember to keep in sync with frontend enums
|
|
48
|
-
enum PageTransitionAlignment
|
|
49
|
-
{
|
|
50
|
-
transitionHorizontal = 0,
|
|
51
|
-
transitionVertical
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// if changed remember to keep in sync with frontend enums
|
|
55
|
-
enum PageTransitionDirection
|
|
56
|
-
{
|
|
57
|
-
transitionInward = 0,
|
|
58
|
-
transitionOutward
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
class POPPLER_PRIVATE_EXPORT PageTransition
|
|
62
|
-
{
|
|
63
|
-
public:
|
|
64
|
-
// Construct a Page Transition.
|
|
65
|
-
explicit PageTransition(Object *trans);
|
|
66
|
-
|
|
67
|
-
// Destructor.
|
|
68
|
-
~PageTransition();
|
|
69
|
-
|
|
70
|
-
// Was the Page Transition created successfully?
|
|
71
|
-
bool isOk() const { return ok; }
|
|
72
|
-
|
|
73
|
-
// Get type
|
|
74
|
-
PageTransitionType getType() const { return type; }
|
|
75
|
-
|
|
76
|
-
// Get duration
|
|
77
|
-
double getDuration() const { return duration; }
|
|
78
|
-
|
|
79
|
-
// Get alignment
|
|
80
|
-
PageTransitionAlignment getAlignment() const { return alignment; }
|
|
81
|
-
|
|
82
|
-
// Get direction
|
|
83
|
-
PageTransitionDirection getDirection() const { return direction; }
|
|
84
|
-
|
|
85
|
-
// Get angle
|
|
86
|
-
int getAngle() const { return angle; }
|
|
87
|
-
|
|
88
|
-
// Get scale
|
|
89
|
-
double getScale() const { return scale; }
|
|
90
|
-
|
|
91
|
-
// Is rectangular?
|
|
92
|
-
bool isRectangular() const { return rectangular; }
|
|
93
|
-
|
|
94
|
-
private:
|
|
95
|
-
PageTransitionType type; // transition style
|
|
96
|
-
double duration; // duration of the effect in seconds
|
|
97
|
-
PageTransitionAlignment alignment; // dimension of the effect
|
|
98
|
-
PageTransitionDirection direction; // direction of motion
|
|
99
|
-
int angle; // direction in degrees
|
|
100
|
-
double scale; // scale
|
|
101
|
-
bool rectangular; // is the area to be flown in rectangular?
|
|
102
|
-
bool ok; // set if created successfully
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
#endif /* PAGE_TRANSITION_H */
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// Parser.h
|
|
4
|
-
//
|
|
5
|
-
// Copyright 1996-2003 Glyph & Cog, LLC
|
|
6
|
-
//
|
|
7
|
-
//========================================================================
|
|
8
|
-
|
|
9
|
-
//========================================================================
|
|
10
|
-
//
|
|
11
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
12
|
-
//
|
|
13
|
-
// All changes made under the Poppler project to this file are licensed
|
|
14
|
-
// under GPL version 2 or later
|
|
15
|
-
//
|
|
16
|
-
// Copyright (C) 2006, 2010, 2013, 2017, 2018, 2020 Albert Astals Cid <aacid@kde.org>
|
|
17
|
-
// Copyright (C) 2012 Hib Eris <hib@hiberis.nl>
|
|
18
|
-
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
|
|
19
|
-
// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
20
|
-
// Copyright (C) 2019 Adam Reichold <adam.reichold@t-online.de>
|
|
21
|
-
//
|
|
22
|
-
// To see a description of the changes please see the Changelog file that
|
|
23
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
24
|
-
//
|
|
25
|
-
//========================================================================
|
|
26
|
-
|
|
27
|
-
#ifndef PARSER_H
|
|
28
|
-
#define PARSER_H
|
|
29
|
-
|
|
30
|
-
#include "Lexer.h"
|
|
31
|
-
|
|
32
|
-
//------------------------------------------------------------------------
|
|
33
|
-
// Parser
|
|
34
|
-
//------------------------------------------------------------------------
|
|
35
|
-
|
|
36
|
-
class POPPLER_PRIVATE_EXPORT Parser
|
|
37
|
-
{
|
|
38
|
-
public:
|
|
39
|
-
// Constructor.
|
|
40
|
-
Parser(XRef *xrefA, Stream *streamA, bool allowStreamsA);
|
|
41
|
-
Parser(XRef *xrefA, Object *objectA, bool allowStreamsA);
|
|
42
|
-
|
|
43
|
-
// Destructor.
|
|
44
|
-
~Parser();
|
|
45
|
-
|
|
46
|
-
Parser(const Parser &) = delete;
|
|
47
|
-
Parser &operator=(const Parser &) = delete;
|
|
48
|
-
|
|
49
|
-
// Get the next object from the input stream. If <simpleOnly> is
|
|
50
|
-
// true, do not parse compound objects (arrays, dictionaries, or
|
|
51
|
-
// streams).
|
|
52
|
-
Object getObj(bool simpleOnly = false, const unsigned char *fileKey = nullptr, CryptAlgorithm encAlgorithm = cryptRC4, int keyLength = 0, int objNum = 0, int objGen = 0, int recursion = 0, bool strict = false,
|
|
53
|
-
bool decryptString = true);
|
|
54
|
-
|
|
55
|
-
Object getObj(int recursion);
|
|
56
|
-
template<typename T>
|
|
57
|
-
Object getObj(T) = delete;
|
|
58
|
-
|
|
59
|
-
// Get stream.
|
|
60
|
-
Stream *getStream() { return lexer.getStream(); }
|
|
61
|
-
|
|
62
|
-
// Get current position in file.
|
|
63
|
-
Goffset getPos() { return lexer.getPos(); }
|
|
64
|
-
|
|
65
|
-
private:
|
|
66
|
-
Lexer lexer; // input stream
|
|
67
|
-
bool allowStreams; // parse stream objects?
|
|
68
|
-
Object buf1, buf2; // next two tokens
|
|
69
|
-
int inlineImg; // set when inline image data is encountered
|
|
70
|
-
|
|
71
|
-
Stream *makeStream(Object &&dict, const unsigned char *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, int recursion, bool strict);
|
|
72
|
-
void shift(int objNum = -1);
|
|
73
|
-
void shift(const char *cmdA, int objNum);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
#endif
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// PopplerCache.h
|
|
4
|
-
//
|
|
5
|
-
// This file is licensed under the GPLv2 or later
|
|
6
|
-
//
|
|
7
|
-
// Copyright (C) 2009 Koji Otani <sho@bbr.jp>
|
|
8
|
-
// Copyright (C) 2009, 2010, 2017, 2018, 2021 Albert Astals Cid <aacid@kde.org>
|
|
9
|
-
// Copyright (C) 2010 Carlos Garcia Campos <carlosgc@gnome.org>
|
|
10
|
-
// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
|
|
11
|
-
//
|
|
12
|
-
//========================================================================
|
|
13
|
-
|
|
14
|
-
#ifndef POPPLER_CACHE_H
|
|
15
|
-
#define POPPLER_CACHE_H
|
|
16
|
-
|
|
17
|
-
#include <algorithm>
|
|
18
|
-
#include <memory>
|
|
19
|
-
#include <utility>
|
|
20
|
-
#include <vector>
|
|
21
|
-
|
|
22
|
-
template<typename Key, typename Item>
|
|
23
|
-
class PopplerCache
|
|
24
|
-
{
|
|
25
|
-
public:
|
|
26
|
-
PopplerCache(const PopplerCache &) = delete;
|
|
27
|
-
PopplerCache &operator=(const PopplerCache &other) = delete;
|
|
28
|
-
|
|
29
|
-
explicit PopplerCache(std::size_t cacheSizeA) { entries.reserve(cacheSizeA); }
|
|
30
|
-
|
|
31
|
-
/* The item returned is owned by the cache */
|
|
32
|
-
Item *lookup(const Key &key)
|
|
33
|
-
{
|
|
34
|
-
if (!entries.empty() && entries.front().first == key) {
|
|
35
|
-
return entries.front().second.get();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
for (auto it = entries.begin(); it != entries.end(); ++it) {
|
|
39
|
-
if (it->first == key) {
|
|
40
|
-
auto *item = it->second.get();
|
|
41
|
-
|
|
42
|
-
std::rotate(entries.begin(), it, std::next(it));
|
|
43
|
-
|
|
44
|
-
return item;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return nullptr;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* The key and item pointers ownership is taken by the cache */
|
|
52
|
-
void put(const Key &key, Item *item)
|
|
53
|
-
{
|
|
54
|
-
if (entries.size() == entries.capacity()) {
|
|
55
|
-
entries.pop_back();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
entries.emplace(entries.begin(), key, std::unique_ptr<Item> { item });
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
private:
|
|
62
|
-
std::vector<std::pair<Key, std::unique_ptr<Item>>> entries;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
#endif
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// PreScanOutputDev.h
|
|
4
|
-
//
|
|
5
|
-
// Copyright 2005 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) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
|
|
17
|
-
// Copyright (C) 2010, 2018-2021 Albert Astals Cid <aacid@kde.org>
|
|
18
|
-
// Copyright (C) 2011, 2014 William Bader <williambader@hotmail.com>
|
|
19
|
-
// Copyright (C) 2011, 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
20
|
-
// Copyright (C) 2011 Adrian Johnson <ajohnson@redneon.com>
|
|
21
|
-
//
|
|
22
|
-
// To see a description of the changes please see the Changelog file that
|
|
23
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
24
|
-
//
|
|
25
|
-
//========================================================================
|
|
26
|
-
|
|
27
|
-
#ifndef PRESCANOUTPUTDEV_H
|
|
28
|
-
#define PRESCANOUTPUTDEV_H
|
|
29
|
-
|
|
30
|
-
#include "Object.h"
|
|
31
|
-
#include "GfxState.h"
|
|
32
|
-
#include "OutputDev.h"
|
|
33
|
-
#include "PSOutputDev.h"
|
|
34
|
-
|
|
35
|
-
//------------------------------------------------------------------------
|
|
36
|
-
// PreScanOutputDev
|
|
37
|
-
//------------------------------------------------------------------------
|
|
38
|
-
|
|
39
|
-
class PreScanOutputDev : public OutputDev
|
|
40
|
-
{
|
|
41
|
-
public:
|
|
42
|
-
// Constructor.
|
|
43
|
-
explicit PreScanOutputDev(PSLevel levelA);
|
|
44
|
-
|
|
45
|
-
// Destructor.
|
|
46
|
-
~PreScanOutputDev() override;
|
|
47
|
-
|
|
48
|
-
//----- get info about output device
|
|
49
|
-
|
|
50
|
-
// Does this device use upside-down coordinates?
|
|
51
|
-
// (Upside-down means (0,0) is the top left corner of the page.)
|
|
52
|
-
bool upsideDown() override { return true; }
|
|
53
|
-
|
|
54
|
-
// Does this device use drawChar() or drawString()?
|
|
55
|
-
bool useDrawChar() override { return true; }
|
|
56
|
-
|
|
57
|
-
// Does this device use tilingPatternFill()? If this returns false,
|
|
58
|
-
// tiling pattern fills will be reduced to a series of other drawing
|
|
59
|
-
// operations.
|
|
60
|
-
bool useTilingPatternFill() override { return true; }
|
|
61
|
-
|
|
62
|
-
// Does this device use functionShadedFill(), axialShadedFill(), and
|
|
63
|
-
// radialShadedFill()? If this returns false, these shaded fills
|
|
64
|
-
// will be reduced to a series of other drawing operations.
|
|
65
|
-
bool useShadedFills(int type) override { return true; }
|
|
66
|
-
|
|
67
|
-
// Does this device use beginType3Char/endType3Char? Otherwise,
|
|
68
|
-
// text in Type 3 fonts will be drawn with drawChar/drawString.
|
|
69
|
-
bool interpretType3Chars() override { return true; }
|
|
70
|
-
|
|
71
|
-
//----- initialization and control
|
|
72
|
-
|
|
73
|
-
// Start a page.
|
|
74
|
-
void startPage(int pageNum, GfxState *state, XRef *xref) override;
|
|
75
|
-
|
|
76
|
-
// End a page.
|
|
77
|
-
void endPage() override;
|
|
78
|
-
|
|
79
|
-
//----- path painting
|
|
80
|
-
void stroke(GfxState *state) override;
|
|
81
|
-
void fill(GfxState *state) override;
|
|
82
|
-
void eoFill(GfxState *state) override;
|
|
83
|
-
bool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, GfxTilingPattern *tPat, const double *mat, int x0, int y0, int x1, int y1, double xStep, double yStep) override;
|
|
84
|
-
bool functionShadedFill(GfxState *state, GfxFunctionShading *shading) override;
|
|
85
|
-
bool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) override;
|
|
86
|
-
bool radialShadedFill(GfxState *state, GfxRadialShading *shading, double tMin, double tMax) override;
|
|
87
|
-
|
|
88
|
-
//----- path clipping
|
|
89
|
-
void clip(GfxState *state) override;
|
|
90
|
-
void eoClip(GfxState *state) override;
|
|
91
|
-
|
|
92
|
-
//----- text drawing
|
|
93
|
-
void beginStringOp(GfxState *state) override;
|
|
94
|
-
void endStringOp(GfxState *state) override;
|
|
95
|
-
bool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen) override;
|
|
96
|
-
void endType3Char(GfxState *state) override;
|
|
97
|
-
|
|
98
|
-
//----- image drawing
|
|
99
|
-
void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, bool invert, bool interpolate, bool inlineImg) override;
|
|
100
|
-
void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, const int *maskColors, bool inlineImg) override;
|
|
101
|
-
void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert, bool maskInterpolate) override;
|
|
102
|
-
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap,
|
|
103
|
-
bool maskInterpolate) override;
|
|
104
|
-
|
|
105
|
-
//----- transparency groups and soft masks
|
|
106
|
-
void beginTransparencyGroup(GfxState *state, const double *bbox, GfxColorSpace *blendingColorSpace, bool isolated, bool knockout, bool forSoftMask) override;
|
|
107
|
-
void paintTransparencyGroup(GfxState *state, const double *bbox) override;
|
|
108
|
-
void setSoftMask(GfxState *state, const double *bbox, bool alpha, Function *transferFunc, GfxColor *backdropColor) override;
|
|
109
|
-
|
|
110
|
-
//----- special access
|
|
111
|
-
|
|
112
|
-
// Returns true if the operations performed since the last call to
|
|
113
|
-
// clearStats() are all monochrome (black or white).
|
|
114
|
-
bool isMonochrome() { return mono; }
|
|
115
|
-
|
|
116
|
-
// Returns true if the operations performed since the last call to
|
|
117
|
-
// clearStats() are all gray.
|
|
118
|
-
bool isGray() { return gray; }
|
|
119
|
-
|
|
120
|
-
// Returns true if the operations performed since the last call to
|
|
121
|
-
// clearStats() included any transparency.
|
|
122
|
-
bool usesTransparency() { return transparency; }
|
|
123
|
-
|
|
124
|
-
// Returns true if the operations performed since the last call to
|
|
125
|
-
// clearStats() are all rasterizable by GDI calls in GDIOutputDev.
|
|
126
|
-
bool isAllGDI() { return gdi; }
|
|
127
|
-
|
|
128
|
-
// Returns true if the operations performed since the last call to
|
|
129
|
-
// clearStats() included any image mask fills with a pattern color
|
|
130
|
-
// space. (only level1!)
|
|
131
|
-
bool usesPatternImageMask() { return patternImgMask; }
|
|
132
|
-
|
|
133
|
-
// Clear the stats used by the above functions.
|
|
134
|
-
void clearStats();
|
|
135
|
-
|
|
136
|
-
private:
|
|
137
|
-
void check(GfxColorSpace *colorSpace, const GfxColor *color, double opacity, GfxBlendMode blendMode);
|
|
138
|
-
|
|
139
|
-
bool mono;
|
|
140
|
-
bool gray;
|
|
141
|
-
bool transparency;
|
|
142
|
-
bool gdi;
|
|
143
|
-
PSLevel level; // PostScript level (1, 2, separation)
|
|
144
|
-
bool patternImgMask;
|
|
145
|
-
int inTilingPatternFill;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
#endif
|