├── .gitignore ├── Cargo.toml ├── LICENSE-GPLv2 ├── LICENSE-GPLv3 ├── README.md ├── build.rs ├── poppler-20.12.1 ├── .git-blame-ignore-revs ├── .gitlab-ci.yml ├── .gitlab │ └── merge_request_templates │ │ └── merge_request_template.md ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── COPYING3 ├── ChangeLog ├── ConfigureChecks.cmake ├── INSTALL ├── NEWS ├── README-XPDF ├── README.contributors ├── README.md ├── _clang-format ├── cmake │ └── modules │ │ ├── COPYING-CMAKE-SCRIPTS │ │ ├── CheckFileOffsetBits.c │ │ ├── CheckFileOffsetBits.cmake │ │ ├── FindCairo.cmake │ │ ├── FindFontconfig.cmake │ │ ├── FindGLIB.cmake │ │ ├── FindGObjectIntrospection.cmake │ │ ├── FindGTK.cmake │ │ ├── FindIconv.cmake │ │ ├── FindLCMS2.cmake │ │ ├── FindNSS3.cmake │ │ ├── GObjectIntrospectionMacros.cmake │ │ ├── MacroOptionalFindPackage.cmake │ │ ├── PopplerDefaults.cmake │ │ └── PopplerMacros.cmake ├── config.h.cmake ├── cpp │ ├── CMakeLists.txt │ ├── Doxyfile │ ├── Mainpage.dox │ ├── poppler-destination-private.h │ ├── poppler-destination.cpp │ ├── poppler-destination.h │ ├── poppler-document-private.h │ ├── poppler-document.cpp │ ├── poppler-document.h │ ├── poppler-embedded-file-private.h │ ├── poppler-embedded-file.cpp │ ├── poppler-embedded-file.h │ ├── poppler-font-private.h │ ├── poppler-font.cpp │ ├── poppler-font.h │ ├── poppler-global.cpp │ ├── poppler-global.h │ ├── poppler-image-private.h │ ├── poppler-image.cpp │ ├── poppler-image.h │ ├── poppler-page-private.h │ ├── poppler-page-renderer.cpp │ ├── poppler-page-renderer.h │ ├── poppler-page-transition.cpp │ ├── poppler-page-transition.h │ ├── poppler-page.cpp │ ├── poppler-page.h │ ├── poppler-private.cpp │ ├── poppler-private.h │ ├── poppler-rectangle.cpp │ ├── poppler-rectangle.h │ ├── poppler-toc-private.h │ ├── poppler-toc.cpp │ ├── poppler-toc.h │ ├── poppler-version.cpp │ ├── poppler-version.h.in │ └── tests │ │ ├── CMakeLists.txt │ │ ├── fuzzing │ │ ├── FuzzedDataProvider.h │ │ ├── doc_fuzzer.cc │ │ ├── fuzzer_temp_file.h │ │ ├── page_label_fuzzer.cc │ │ ├── page_search_fuzzer.cc │ │ ├── pdf_file_fuzzer.cc │ │ └── pdf_fuzzer.cc │ │ ├── poppler-dump.cpp │ │ └── poppler-render.cpp ├── fofi │ ├── FoFiBase.cc │ ├── FoFiBase.h │ ├── FoFiEncodings.cc │ ├── FoFiEncodings.h │ ├── FoFiIdentifier.cc │ ├── FoFiIdentifier.h │ ├── FoFiTrueType.cc │ ├── FoFiTrueType.h │ ├── FoFiType1.cc │ ├── FoFiType1.h │ ├── FoFiType1C.cc │ └── FoFiType1C.h ├── glib │ ├── CMakeLists.txt │ ├── demo │ │ ├── CMakeLists.txt │ │ ├── annots.c │ │ ├── annots.h │ │ ├── attachments.c │ │ ├── attachments.h │ │ ├── find.c │ │ ├── find.h │ │ ├── fonts.c │ │ ├── fonts.h │ │ ├── forms.c │ │ ├── forms.h │ │ ├── images.c │ │ ├── images.h │ │ ├── info.cc │ │ ├── info.h │ │ ├── layers.c │ │ ├── layers.h │ │ ├── links.c │ │ ├── links.h │ │ ├── main.c │ │ ├── outline.c │ │ ├── outline.h │ │ ├── page.c │ │ ├── page.h │ │ ├── print.c │ │ ├── print.h │ │ ├── render.c │ │ ├── render.h │ │ ├── selections.c │ │ ├── selections.h │ │ ├── taggedstruct.c │ │ ├── taggedstruct.h │ │ ├── text.c │ │ ├── text.h │ │ ├── transitions.c │ │ ├── transitions.h │ │ ├── utils.c │ │ └── utils.h │ ├── poppler-action.cc │ ├── poppler-action.h │ ├── poppler-annot.cc │ ├── poppler-annot.h │ ├── poppler-attachment.cc │ ├── poppler-attachment.h │ ├── poppler-cached-file-loader.cc │ ├── poppler-cached-file-loader.h │ ├── poppler-date.cc │ ├── poppler-date.h │ ├── poppler-document.cc │ ├── poppler-document.h │ ├── poppler-enums.c.template │ ├── poppler-enums.h.template │ ├── poppler-features.h.cmake │ ├── poppler-form-field.cc │ ├── poppler-form-field.h │ ├── poppler-input-stream.cc │ ├── poppler-input-stream.h │ ├── poppler-layer.cc │ ├── poppler-layer.h │ ├── poppler-macros.h │ ├── poppler-media.cc │ ├── poppler-media.h │ ├── poppler-movie.cc │ ├── poppler-movie.h │ ├── poppler-page.cc │ ├── poppler-page.h │ ├── poppler-private.h │ ├── poppler-structure-element.cc │ ├── poppler-structure-element.h │ ├── poppler.cc │ ├── poppler.h │ ├── reference │ │ ├── CMakeLists.txt │ │ ├── html │ │ │ ├── PopplerAction.html │ │ │ ├── PopplerAttachment.html │ │ │ ├── PopplerDocument.html │ │ │ ├── PopplerFormField.html │ │ │ ├── PopplerStructureElement.html │ │ │ ├── annotation-glossary.html │ │ │ ├── api-index-0-12.html │ │ │ ├── api-index-0-14.html │ │ │ ├── api-index-0-16.html │ │ │ ├── api-index-0-18.html │ │ │ ├── api-index-0-20.html │ │ │ ├── api-index-0-22.html │ │ │ ├── api-index-0-26.html │ │ │ ├── api-index-0-33.html │ │ │ ├── api-index-0-46.html │ │ │ ├── api-index-0-54.html │ │ │ ├── api-index-0-70.html │ │ │ ├── api-index-0-72.html │ │ │ ├── api-index-0-73.html │ │ │ ├── api-index-0-78.html │ │ │ ├── api-index-0-80.html │ │ │ ├── api-index-0-82.html │ │ │ ├── api-index-0-88.html │ │ │ ├── api-index-0-89.html │ │ │ ├── api-index-0-90.html │ │ │ ├── api-index-full.html │ │ │ ├── ch01.html │ │ │ ├── home.png │ │ │ ├── index.html │ │ │ ├── left-insensitive.png │ │ │ ├── left.png │ │ │ ├── poppler-Error-handling.html │ │ │ ├── poppler-PDF-Utility-functions.html │ │ │ ├── poppler-Poppler-Annotation.html │ │ │ ├── poppler-Poppler-Color.html │ │ │ ├── poppler-Poppler-Features.html │ │ │ ├── poppler-Poppler-Layer.html │ │ │ ├── poppler-Poppler-Media.html │ │ │ ├── poppler-Poppler-Movie.html │ │ │ ├── poppler-Poppler-Page.html │ │ │ ├── poppler-Poppler-Text-Span.html │ │ │ ├── poppler.devhelp2 │ │ │ ├── right-insensitive.png │ │ │ ├── right.png │ │ │ ├── style.css │ │ │ ├── up-insensitive.png │ │ │ └── up.png │ │ ├── poppler-docs.sgml │ │ ├── poppler-overrides.txt │ │ ├── poppler-sections.txt │ │ └── poppler.types │ └── tests │ │ ├── CMakeLists.txt │ │ ├── check_bb.c │ │ ├── check_text.c │ │ ├── fuzzing │ │ ├── annot_fuzzer.cc │ │ ├── doc_attr_fuzzer.cc │ │ ├── find_text_fuzzer.cc │ │ ├── fuzzer_temp_file.h │ │ ├── label_fuzzer.cc │ │ ├── pdf_draw_fuzzer.cc │ │ └── util_fuzzer.cc │ │ └── pdfdrawbb.c ├── goo │ ├── GooCheckedOps.h │ ├── GooLikely.h │ ├── GooString.cc │ ├── GooString.h │ ├── GooTimer.cc │ ├── GooTimer.h │ ├── ImgWriter.cc │ ├── ImgWriter.h │ ├── JpegWriter.cc │ ├── JpegWriter.h │ ├── NetPBMWriter.cc │ ├── NetPBMWriter.h │ ├── PNGWriter.cc │ ├── PNGWriter.h │ ├── TiffWriter.cc │ ├── TiffWriter.h │ ├── gbase64.cc │ ├── gbase64.h │ ├── gbasename.cc │ ├── gbasename.h │ ├── gdir.h │ ├── gfile.cc │ ├── gfile.h │ ├── glibc.cc │ ├── glibc.h │ ├── glibc_strtok_r.cc │ ├── gmem.h │ ├── grandom.cc │ ├── grandom.h │ ├── gstrtod.cc │ └── gstrtod.h ├── gtkdoc.py ├── hooks │ └── pre-commit ├── make-glib-api-docs ├── poppler-cpp.pc.cmake ├── poppler-glib.pc.cmake ├── poppler-qt5.pc.cmake ├── poppler.pc.cmake ├── poppler │ ├── Annot.cc │ ├── Annot.h │ ├── Array.cc │ ├── Array.h │ ├── BBoxOutputDev.cc │ ├── BBoxOutputDev.h │ ├── BuiltinFont.h │ ├── BuiltinFontWidth.h │ ├── CMap.cc │ ├── CMap.h │ ├── CachedFile.cc │ ├── CachedFile.h │ ├── CairoFontEngine.cc │ ├── CairoFontEngine.h │ ├── CairoOutputDev.cc │ ├── CairoOutputDev.h │ ├── CairoRescaleBox.cc │ ├── CairoRescaleBox.h │ ├── Catalog.cc │ ├── Catalog.h │ ├── CertificateInfo.cc │ ├── CertificateInfo.h │ ├── CharCodeToUnicode.cc │ ├── CharCodeToUnicode.h │ ├── CharTypes.h │ ├── CourierBoldObliqueWidths.gperf │ ├── CourierBoldObliqueWidths.pregenerated.c │ ├── CourierBoldWidths.gperf │ ├── CourierBoldWidths.pregenerated.c │ ├── CourierObliqueWidths.gperf │ ├── CourierObliqueWidths.pregenerated.c │ ├── CourierWidths.gperf │ ├── CourierWidths.pregenerated.c │ ├── CurlCachedFile.cc │ ├── CurlCachedFile.h │ ├── CurlPDFDocBuilder.cc │ ├── CurlPDFDocBuilder.h │ ├── DCTStream.cc │ ├── DCTStream.h │ ├── DateInfo.cc │ ├── DateInfo.h │ ├── Decrypt.cc │ ├── Decrypt.h │ ├── Dict.cc │ ├── Dict.h │ ├── Error.cc │ ├── Error.h │ ├── ErrorCodes.h │ ├── FileSpec.cc │ ├── FileSpec.h │ ├── FlateEncoder.cc │ ├── FlateEncoder.h │ ├── FlateStream.cc │ ├── FlateStream.h │ ├── FontEncodingTables.cc │ ├── FontEncodingTables.h │ ├── FontInfo.cc │ ├── FontInfo.h │ ├── Form.cc │ ├── Form.h │ ├── Function.cc │ ├── Function.h │ ├── Gfx.cc │ ├── Gfx.h │ ├── GfxFont.cc │ ├── GfxFont.h │ ├── GfxState.cc │ ├── GfxState.h │ ├── GfxState_helpers.h │ ├── GlobalParams.cc │ ├── GlobalParams.h │ ├── GlobalParamsWin.cc │ ├── HelveticaBoldObliqueWidths.gperf │ ├── HelveticaBoldObliqueWidths.pregenerated.c │ ├── HelveticaBoldWidths.gperf │ ├── HelveticaBoldWidths.pregenerated.c │ ├── HelveticaObliqueWidths.gperf │ ├── HelveticaObliqueWidths.pregenerated.c │ ├── HelveticaWidths.gperf │ ├── HelveticaWidths.pregenerated.c │ ├── Hints.cc │ ├── Hints.h │ ├── JArithmeticDecoder.cc │ ├── JArithmeticDecoder.h │ ├── JBIG2Stream.cc │ ├── JBIG2Stream.h │ ├── JPEG2000Stream.cc │ ├── JPEG2000Stream.h │ ├── JPXStream.cc │ ├── JPXStream.h │ ├── JSInfo.cc │ ├── JSInfo.h │ ├── Lexer.cc │ ├── Lexer.h │ ├── Linearization.cc │ ├── Linearization.h │ ├── Link.cc │ ├── Link.h │ ├── LocalPDFDocBuilder.cc │ ├── LocalPDFDocBuilder.h │ ├── MarkedContentOutputDev.cc │ ├── MarkedContentOutputDev.h │ ├── Movie.cc │ ├── Movie.h │ ├── NameToCharCode.cc │ ├── NameToCharCode.h │ ├── NameToUnicodeTable.h │ ├── Object.cc │ ├── Object.h │ ├── OptionalContent.cc │ ├── OptionalContent.h │ ├── Outline.cc │ ├── Outline.h │ ├── OutputDev.cc │ ├── OutputDev.h │ ├── PDFDoc.cc │ ├── PDFDoc.h │ ├── PDFDocBuilder.cc │ ├── PDFDocBuilder.h │ ├── PDFDocEncoding.cc │ ├── PDFDocEncoding.h │ ├── PDFDocFactory.cc │ ├── PDFDocFactory.h │ ├── PSOutputDev.cc │ ├── PSOutputDev.h │ ├── PSTokenizer.cc │ ├── PSTokenizer.h │ ├── Page.cc │ ├── Page.h │ ├── PageLabelInfo.cc │ ├── PageLabelInfo.h │ ├── PageLabelInfo_p.h │ ├── PageTransition.cc │ ├── PageTransition.h │ ├── Parser.cc │ ├── Parser.h │ ├── PopplerCache.h │ ├── PreScanOutputDev.cc │ ├── PreScanOutputDev.h │ ├── ProfileData.cc │ ├── ProfileData.h │ ├── Rendition.cc │ ├── Rendition.h │ ├── SecurityHandler.cc │ ├── SecurityHandler.h │ ├── SignatureHandler.cc │ ├── SignatureHandler.h │ ├── SignatureInfo.cc │ ├── SignatureInfo.h │ ├── Sound.cc │ ├── Sound.h │ ├── SplashOutputDev.cc │ ├── SplashOutputDev.h │ ├── StdinCachedFile.cc │ ├── StdinCachedFile.h │ ├── StdinPDFDocBuilder.cc │ ├── StdinPDFDocBuilder.h │ ├── Stream-CCITT.h │ ├── Stream.cc │ ├── Stream.h │ ├── StructElement.cc │ ├── StructElement.h │ ├── StructTreeRoot.cc │ ├── StructTreeRoot.h │ ├── SymbolWidths.gperf │ ├── SymbolWidths.pregenerated.c │ ├── TextOutputDev.cc │ ├── TextOutputDev.h │ ├── TimesBoldItalicWidths.gperf │ ├── TimesBoldItalicWidths.pregenerated.c │ ├── TimesBoldWidths.gperf │ ├── TimesBoldWidths.pregenerated.c │ ├── TimesItalicWidths.gperf │ ├── TimesItalicWidths.pregenerated.c │ ├── TimesRomanWidths.gperf │ ├── TimesRomanWidths.pregenerated.c │ ├── UTF.cc │ ├── UTF.h │ ├── UnicodeCClassTables.h │ ├── UnicodeCompTables.h │ ├── UnicodeDecompTables.h │ ├── UnicodeMap.cc │ ├── UnicodeMap.h │ ├── UnicodeMapFuncs.cc │ ├── UnicodeMapFuncs.h │ ├── UnicodeMapTables.h │ ├── UnicodeTypeTable.cc │ ├── UnicodeTypeTable.h │ ├── ViewerPreferences.cc │ ├── ViewerPreferences.h │ ├── XRef.cc │ ├── XRef.h │ ├── ZapfDingbatsWidths.gperf │ ├── ZapfDingbatsWidths.pregenerated.c │ ├── gen-unicode-tables.py │ └── poppler-config.h.cmake ├── qt5 │ ├── CMakeLists.txt │ ├── demos │ │ ├── CMakeLists.txt │ │ ├── abstractinfodock.cpp │ │ ├── abstractinfodock.h │ │ ├── documentobserver.cpp │ │ ├── documentobserver.h │ │ ├── embeddedfiles.cpp │ │ ├── embeddedfiles.h │ │ ├── fonts.cpp │ │ ├── fonts.h │ │ ├── info.cpp │ │ ├── info.h │ │ ├── main_viewer.cpp │ │ ├── metadata.cpp │ │ ├── metadata.h │ │ ├── navigationtoolbar.cpp │ │ ├── navigationtoolbar.h │ │ ├── optcontent.cpp │ │ ├── optcontent.h │ │ ├── pageview.cpp │ │ ├── pageview.h │ │ ├── permissions.cpp │ │ ├── permissions.h │ │ ├── thumbnails.cpp │ │ ├── thumbnails.h │ │ ├── toc.cpp │ │ ├── toc.h │ │ ├── viewer.cpp │ │ └── viewer.h │ ├── src │ │ ├── CMakeLists.txt │ │ ├── Doxyfile │ │ ├── Mainpage.dox │ │ ├── QPainterOutputDev.cc │ │ ├── QPainterOutputDev.h │ │ ├── poppler-annotation-helper.h │ │ ├── poppler-annotation-private.h │ │ ├── poppler-annotation.cc │ │ ├── poppler-annotation.h │ │ ├── poppler-base-converter.cc │ │ ├── poppler-converter-private.h │ │ ├── poppler-document.cc │ │ ├── poppler-embeddedfile-private.h │ │ ├── poppler-embeddedfile.cc │ │ ├── poppler-export.h │ │ ├── poppler-fontinfo.cc │ │ ├── poppler-form.cc │ │ ├── poppler-form.h │ │ ├── poppler-link-extractor-private.h │ │ ├── poppler-link-extractor.cc │ │ ├── poppler-link-private.h │ │ ├── poppler-link.cc │ │ ├── poppler-link.h │ │ ├── poppler-media.cc │ │ ├── poppler-media.h │ │ ├── poppler-movie.cc │ │ ├── poppler-optcontent-private.h │ │ ├── poppler-optcontent.cc │ │ ├── poppler-optcontent.h │ │ ├── poppler-outline-private.h │ │ ├── poppler-outline.cc │ │ ├── poppler-page-private.h │ │ ├── poppler-page-transition-private.h │ │ ├── poppler-page-transition.cc │ │ ├── poppler-page-transition.h │ │ ├── poppler-page.cc │ │ ├── poppler-pdf-converter.cc │ │ ├── poppler-private.cc │ │ ├── poppler-private.h │ │ ├── poppler-ps-converter.cc │ │ ├── poppler-qiodeviceinstream-private.h │ │ ├── poppler-qiodeviceinstream.cc │ │ ├── poppler-qiodeviceoutstream-private.h │ │ ├── poppler-qiodeviceoutstream.cc │ │ ├── poppler-qt5.h │ │ ├── poppler-sound.cc │ │ ├── poppler-textbox.cc │ │ ├── poppler-version.cpp │ │ └── poppler-version.h.in │ └── tests │ │ ├── CMakeLists.txt │ │ ├── README.unittest │ │ ├── check_actualtext.cpp │ │ ├── check_annotations.cpp │ │ ├── check_attachments.cpp │ │ ├── check_dateConversion.cpp │ │ ├── check_fonts.cpp │ │ ├── check_forms.cpp │ │ ├── check_goostring.cpp │ │ ├── check_lexer.cpp │ │ ├── check_links.cpp │ │ ├── check_metadata.cpp │ │ ├── check_object.cpp │ │ ├── check_optcontent.cpp │ │ ├── check_outline.cpp │ │ ├── check_pagelabelinfo.cpp │ │ ├── check_pagelayout.cpp │ │ ├── check_pagemode.cpp │ │ ├── check_password.cpp │ │ ├── check_permissions.cpp │ │ ├── check_search.cpp │ │ ├── check_strings.cpp │ │ ├── check_stroke_opacity.cpp │ │ ├── check_utf_conversion.cpp │ │ ├── fuzzing │ │ ├── qt_annot_fuzzer.cc │ │ ├── qt_label_fuzzer.cc │ │ ├── qt_pdf_fuzzer.cc │ │ ├── qt_search_fuzzer.cc │ │ └── qt_textbox_fuzzer.cc │ │ ├── poppler-attachments.cpp │ │ ├── poppler-fonts.cpp │ │ ├── poppler-forms.cpp │ │ ├── poppler-page-labels.cpp │ │ ├── poppler-texts.cpp │ │ ├── stress-poppler-dir.cpp │ │ ├── stress-poppler-qt5.cpp │ │ ├── stress-threads-qt5.cpp │ │ ├── test-password-qt5.cpp │ │ ├── test-poppler-qt5.cpp │ │ └── test-render-to-file.cpp ├── qt6 │ ├── CMakeLists.txt │ ├── demos │ │ ├── CMakeLists.txt │ │ ├── abstractinfodock.cpp │ │ ├── abstractinfodock.h │ │ ├── documentobserver.cpp │ │ ├── documentobserver.h │ │ ├── embeddedfiles.cpp │ │ ├── embeddedfiles.h │ │ ├── fonts.cpp │ │ ├── fonts.h │ │ ├── info.cpp │ │ ├── info.h │ │ ├── main_viewer.cpp │ │ ├── metadata.cpp │ │ ├── metadata.h │ │ ├── navigationtoolbar.cpp │ │ ├── navigationtoolbar.h │ │ ├── optcontent.cpp │ │ ├── optcontent.h │ │ ├── pageview.cpp │ │ ├── pageview.h │ │ ├── permissions.cpp │ │ ├── permissions.h │ │ ├── thumbnails.cpp │ │ ├── thumbnails.h │ │ ├── toc.cpp │ │ ├── toc.h │ │ ├── viewer.cpp │ │ └── viewer.h │ ├── src │ │ ├── CMakeLists.txt │ │ ├── Doxyfile │ │ ├── Mainpage.dox │ │ ├── QPainterOutputDev.cc │ │ ├── QPainterOutputDev.h │ │ ├── poppler-annotation-helper.h │ │ ├── poppler-annotation-private.h │ │ ├── poppler-annotation-private.h.orig │ │ ├── poppler-annotation.cc │ │ ├── poppler-annotation.h │ │ ├── poppler-base-converter.cc │ │ ├── poppler-converter-private.h │ │ ├── poppler-document.cc │ │ ├── poppler-embeddedfile-private.h │ │ ├── poppler-embeddedfile.cc │ │ ├── poppler-export.h │ │ ├── poppler-fontinfo.cc │ │ ├── poppler-form.cc │ │ ├── poppler-form.h │ │ ├── poppler-link-extractor-private.h │ │ ├── poppler-link-extractor.cc │ │ ├── poppler-link-private.h │ │ ├── poppler-link.cc │ │ ├── poppler-link.h │ │ ├── poppler-media.cc │ │ ├── poppler-media.h │ │ ├── poppler-movie.cc │ │ ├── poppler-optcontent-private.h │ │ ├── poppler-optcontent.cc │ │ ├── poppler-optcontent.h │ │ ├── poppler-outline-private.h │ │ ├── poppler-outline.cc │ │ ├── poppler-page-private.h │ │ ├── poppler-page-transition-private.h │ │ ├── poppler-page-transition.cc │ │ ├── poppler-page-transition.h │ │ ├── poppler-page.cc │ │ ├── poppler-pdf-converter.cc │ │ ├── poppler-private.cc │ │ ├── poppler-private.h │ │ ├── poppler-ps-converter.cc │ │ ├── poppler-qiodeviceinstream-private.h │ │ ├── poppler-qiodeviceinstream.cc │ │ ├── poppler-qiodeviceoutstream-private.h │ │ ├── poppler-qiodeviceoutstream.cc │ │ ├── poppler-qt6.h │ │ ├── poppler-sound.cc │ │ ├── poppler-textbox.cc │ │ ├── poppler-version.cpp │ │ └── poppler-version.h.in │ └── tests │ │ ├── CMakeLists.txt │ │ ├── README.unittest │ │ ├── check_actualtext.cpp │ │ ├── check_annotations.cpp │ │ ├── check_attachments.cpp │ │ ├── check_dateConversion.cpp │ │ ├── check_fonts.cpp │ │ ├── check_forms.cpp │ │ ├── check_goostring.cpp │ │ ├── check_lexer.cpp │ │ ├── check_links.cpp │ │ ├── check_metadata.cpp │ │ ├── check_object.cpp │ │ ├── check_optcontent.cpp │ │ ├── check_outline.cpp │ │ ├── check_pagelabelinfo.cpp │ │ ├── check_pagelayout.cpp │ │ ├── check_pagemode.cpp │ │ ├── check_password.cpp │ │ ├── check_permissions.cpp │ │ ├── check_search.cpp │ │ ├── check_strings.cpp │ │ ├── check_stroke_opacity.cpp │ │ ├── check_utf_conversion.cpp │ │ ├── poppler-attachments.cpp │ │ ├── poppler-fonts.cpp │ │ ├── poppler-forms.cpp │ │ ├── poppler-page-labels.cpp │ │ ├── poppler-texts.cpp │ │ ├── stress-poppler-dir.cpp │ │ ├── stress-poppler-qt6.cpp │ │ ├── stress-threads-qt6.cpp │ │ ├── test-password-qt6.cpp │ │ ├── test-poppler-qt6.cpp │ │ └── test-render-to-file.cpp ├── splash │ ├── Splash.cc │ ├── Splash.h │ ├── SplashBitmap.cc │ ├── SplashBitmap.h │ ├── SplashClip.cc │ ├── SplashClip.h │ ├── SplashErrorCodes.h │ ├── SplashFTFont.cc │ ├── SplashFTFont.h │ ├── SplashFTFontEngine.cc │ ├── SplashFTFontEngine.h │ ├── SplashFTFontFile.cc │ ├── SplashFTFontFile.h │ ├── SplashFont.cc │ ├── SplashFont.h │ ├── SplashFontEngine.cc │ ├── SplashFontEngine.h │ ├── SplashFontFile.cc │ ├── SplashFontFile.h │ ├── SplashFontFileID.cc │ ├── SplashFontFileID.h │ ├── SplashGlyphBitmap.h │ ├── SplashMath.h │ ├── SplashPath.cc │ ├── SplashPath.h │ ├── SplashPattern.cc │ ├── SplashPattern.h │ ├── SplashScreen.cc │ ├── SplashScreen.h │ ├── SplashState.cc │ ├── SplashState.h │ ├── SplashTypes.h │ ├── SplashXPath.cc │ ├── SplashXPath.h │ ├── SplashXPathScanner.cc │ └── SplashXPathScanner.h ├── test │ ├── CMakeLists.txt │ ├── goostring-format-checker │ │ ├── README │ │ └── goostring-format-checker.cc │ ├── gtk-test.cc │ ├── pdf-fullrewrite.cc │ ├── pdf-inspector.cc │ ├── pdf-inspector.ui │ ├── pdf-operators.c │ ├── perf-test-preview-dummy.cc │ ├── perf-test-preview-win.cc │ └── perf-test.cc └── utils │ ├── CMakeLists.txt │ ├── HtmlFonts.cc │ ├── HtmlFonts.h │ ├── HtmlLinks.cc │ ├── HtmlLinks.h │ ├── HtmlOutputDev.cc │ ├── HtmlOutputDev.h │ ├── HtmlUtils.h │ ├── ImageOutputDev.cc │ ├── ImageOutputDev.h │ ├── InMemoryFile.cc │ ├── InMemoryFile.h │ ├── Win32Console.cc │ ├── Win32Console.h │ ├── numberofcharacters.h │ ├── parseargs.cc │ ├── parseargs.h │ ├── pdf2xml.dtd │ ├── pdfattach.1 │ ├── pdfattach.cc │ ├── pdfdetach.1 │ ├── pdfdetach.cc │ ├── pdffonts.1 │ ├── pdffonts.cc │ ├── pdfimages.1 │ ├── pdfimages.cc │ ├── pdfinfo.1 │ ├── pdfinfo.cc │ ├── pdfseparate.1 │ ├── pdfseparate.cc │ ├── pdfsig.1 │ ├── pdfsig.cc │ ├── pdftocairo-win32.cc │ ├── pdftocairo-win32.h │ ├── pdftocairo.1 │ ├── pdftocairo.cc │ ├── pdftohtml.1 │ ├── pdftohtml.cc │ ├── pdftoppm.1 │ ├── pdftoppm.cc │ ├── pdftops.1 │ ├── pdftops.cc │ ├── pdftotext.1 │ ├── pdftotext.cc │ ├── pdfunite.1 │ ├── pdfunite.cc │ ├── printencodings.cc │ └── printencodings.h ├── src ├── callpoppler.cc └── lib.rs └── test.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pdftotext" 3 | version = "0.1.5" 4 | authors = ["Elias Gabriel Amaral da Silva "] 5 | edition = "2018" 6 | license = "GPL-2.0 OR GPL-3.0" 7 | readme = "README.md" 8 | repository = "https://github.com/dlight/pdftotext" 9 | homepage = "https://github.com/dlight/pdftotext" 10 | documentation = "https://docs.rs/pdftotext" 11 | description = """ 12 | High-level library that binds to Poppler to extract text from a PDF 13 | """ 14 | keywords = ["poppler", "pdf", "text"] 15 | categories = ["api-bindings"] 16 | 17 | [features] 18 | default = [] 19 | static-poppler = ["cmake"] 20 | 21 | 22 | [build-dependencies] 23 | cc = "1.0" 24 | pkg-config = "0.3" 25 | cmake = { version = "0.1", optional = true } 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pdftotext 2 | 3 | This crate extracts [Poppler](https://poppler.freedesktop.org/)'s `pdftotext 4 | -layout` code into a library, linking dynamically to system's Poppler. 5 | 6 | The library was tested with Poppler 20.12.1. It calls popper's internal APIs so it 7 | may break with future library versions. If this is a concern, build with 8 | `static-poppler` enabled, which statically links vendored Poppler 20.12.1. 9 | -------------------------------------------------------------------------------- /poppler-20.12.1/.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # _clang_format added 2 | 814fbda28cc8a37fed3134c2db8da28f86fb5ee0 3 | -------------------------------------------------------------------------------- /poppler-20.12.1/.gitlab/merge_request_templates/merge_request_template.md: -------------------------------------------------------------------------------- 1 | Please make sure you check the "Allow commits from members who can merge to the target branch" option at the bottom of the page. 2 | 3 | Makes our life much easier since we can rebase and merge from the web user interface. 4 | -------------------------------------------------------------------------------- /poppler-20.12.1/AUTHORS: -------------------------------------------------------------------------------- 1 | xpdf is written by Derek Noonburg 2 | 3 | libpoppler is a fork of xpdf-3.00 4 | 5 | Current Maintainer: Albert Astals Cid 6 | -------------------------------------------------------------------------------- /poppler-20.12.1/cmake/modules/COPYING-CMAKE-SCRIPTS: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions 3 | are met: 4 | 5 | 1. Redistributions of source code must retain the copyright 6 | notice, this list of conditions and the following disclaimer. 7 | 2. Redistributions in binary form must reproduce the copyright 8 | notice, this list of conditions and the following disclaimer in the 9 | documentation and/or other materials provided with the distribution. 10 | 3. The name of the author may not be used to endorse or promote products 11 | derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /poppler-20.12.1/cmake/modules/CheckFileOffsetBits.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define KB ((off_t)1024) 4 | #define MB ((off_t)1024 * KB) 5 | #define GB ((off_t)1024 * MB) 6 | #define TB ((off_t)1024 * GB) 7 | int t2[(((64 * GB - 1) % 671088649) == 268434537) && (((TB - (64 * GB - 1) + 255) % 1792151290) == 305159546) ? 1 : -1]; 8 | 9 | int main() 10 | { 11 | ; 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /poppler-20.12.1/cmake/modules/FindGLIB.cmake: -------------------------------------------------------------------------------- 1 | # - try to find the GLIB libraries 2 | # Once done this will define 3 | # 4 | # GLIB_FOUND - system has GLib 5 | # GLIB2_CFLAGS - the GLib CFlags 6 | # GLIB2_LIBRARIES - Link these to use GLib 7 | # 8 | # Copyright 2008-2010 Pino Toscano, 9 | # Copyright 2013 Michael Weiser, 10 | # 11 | # Redistribution and use is allowed according to the terms of the BSD license. 12 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 13 | 14 | include(FindPackageHandleStandardArgs) 15 | 16 | find_package(PkgConfig REQUIRED) 17 | 18 | if(${CMAKE_VERSION} VERSION_LESS "3.6.0") 19 | pkg_check_modules(GLIB2 "glib-2.0>=${GLIB_REQUIRED}" "gobject-2.0>=${GLIB_REQUIRED}" "gio-2.0>=${GLIB_REQUIRED}") 20 | else() 21 | pkg_check_modules(GLIB2 IMPORTED_TARGET "glib-2.0>=${GLIB_REQUIRED}" "gobject-2.0>=${GLIB_REQUIRED}" "gio-2.0>=${GLIB_REQUIRED}") 22 | endif() 23 | 24 | find_package_handle_standard_args(GLIB DEFAULT_MSG GLIB2_LIBRARIES GLIB2_CFLAGS) 25 | -------------------------------------------------------------------------------- /poppler-20.12.1/cmake/modules/FindGTK.cmake: -------------------------------------------------------------------------------- 1 | # - try to find GTK libraries 2 | # Once done this will define 3 | # 4 | # GTK_FOUND - system has GTK 5 | # GTK3_CFLAGS - the GTK CFlags 6 | # GTK3_LIBRARIES - Link these to use GTK 7 | # 8 | # Copyright 2008-2010 Pino Toscano, 9 | # 10 | # Redistribution and use is allowed according to the terms of the BSD license. 11 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 12 | 13 | # NOTE: As of cmake v3.18, built-in FindGTK is *only* valid for GTK1 14 | 15 | include(FindPackageHandleStandardArgs) 16 | 17 | find_package(PkgConfig REQUIRED) 18 | 19 | if(${CMAKE_VERSION} VERSION_LESS "3.6.0") 20 | pkg_check_modules(GTK3 "gtk+-3.0>=${GTK_REQUIRED}" "gdk-pixbuf-2.0>=${GDK_PIXBUF_REQUIRED}") 21 | else() 22 | pkg_check_modules(GTK3 IMPORTED_TARGET "gtk+-3.0>=${GTK_REQUIRED}" "gdk-pixbuf-2.0>=${GDK_PIXBUF_REQUIRED}") 23 | endif() 24 | 25 | find_package_handle_standard_args(GTK DEFAULT_MSG GTK3_LIBRARIES GTK3_CFLAGS) 26 | -------------------------------------------------------------------------------- /poppler-20.12.1/cmake/modules/FindNSS3.cmake: -------------------------------------------------------------------------------- 1 | # - try to find NSS3 libraries 2 | # Once done this will define 3 | # 4 | # NSS_FOUND - system has NSS3 5 | # NSS3_CFLAGS - the NSS CFlags 6 | # NSS3_LIBRARIES - Link these to use NSS 7 | # 8 | # Copyright 2015 André Guerreiro, 9 | # 10 | # Redistribution and use is allowed according to the terms of the BSD license. 11 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 12 | 13 | include(FindPackageHandleStandardArgs) 14 | 15 | if (NOT MSVC) 16 | find_package(PkgConfig REQUIRED) 17 | 18 | if(${CMAKE_VERSION} VERSION_LESS "3.6.0") 19 | pkg_check_modules(NSS3 "nss>=3.19") 20 | else () 21 | pkg_check_modules(NSS3 IMPORTED_TARGET "nss>=3.19") 22 | endif() 23 | 24 | find_package_handle_standard_args(NSS3 DEFAULT_MSG NSS3_LIBRARIES NSS3_CFLAGS) 25 | 26 | endif(NOT MSVC) 27 | -------------------------------------------------------------------------------- /poppler-20.12.1/cmake/modules/PopplerDefaults.cmake: -------------------------------------------------------------------------------- 1 | # enable the testing facilities 2 | enable_testing() 3 | 4 | # put the include directories of the sources before other include paths 5 | # (eg, system includes) 6 | set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) 7 | 8 | # colored output 9 | set(CMAKE_COLOR_MAKEFILE ON) 10 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | ${CMAKE_CURRENT_SOURCE_DIR} 3 | ${CMAKE_CURRENT_BINARY_DIR} 4 | ${ICONV_INCLUDE_DIR} 5 | ) 6 | 7 | configure_file(poppler-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h @ONLY) 8 | 9 | add_subdirectory(tests) 10 | 11 | set(poppler_cpp_SRCS 12 | poppler-destination.cpp 13 | poppler-document.cpp 14 | poppler-embedded-file.cpp 15 | poppler-font.cpp 16 | poppler-global.cpp 17 | poppler-image.cpp 18 | poppler-page.cpp 19 | poppler-page-renderer.cpp 20 | poppler-page-transition.cpp 21 | poppler-private.cpp 22 | poppler-rectangle.cpp 23 | poppler-toc.cpp 24 | poppler-version.cpp 25 | ) 26 | 27 | add_library(poppler-cpp ${poppler_cpp_SRCS}) 28 | set_target_properties(poppler-cpp PROPERTIES VERSION 0.9.0 SOVERSION 0) 29 | if(MINGW AND BUILD_SHARED_LIBS) 30 | get_target_property(POPPLER_CPP_SOVERSION poppler-cpp SOVERSION) 31 | set_target_properties(poppler-cpp PROPERTIES SUFFIX "-${POPPLER_CPP_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") 32 | endif() 33 | target_link_libraries(poppler-cpp poppler ${ICONV_LIBRARIES}) 34 | install(TARGETS poppler-cpp RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 35 | 36 | install(FILES 37 | poppler-destination.h 38 | poppler-document.h 39 | poppler-embedded-file.h 40 | poppler-font.h 41 | poppler-font-private.h 42 | poppler-global.h 43 | poppler-image.h 44 | poppler-page.h 45 | poppler-page-renderer.h 46 | poppler-page-transition.h 47 | poppler-rectangle.h 48 | poppler-toc.h 49 | ${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h 50 | DESTINATION include/poppler/cpp) 51 | 52 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/Mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage The Poppler CPP interface library 3 | 4 | The Poppler CPP interface library, called libpoppler-cpp, is a library that 5 | allows C++ programmers to easily load and render PDF files using the Poppler 6 | library. Unlike the other Poppler frontends, it has no additional 7 | requirements, so can be used in any C++ application. 8 | 9 | */ 10 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/poppler-destination-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019, Masamichi Hosoda 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef POPPLER_DESTINATION_PRIVATE_H 20 | #define POPPLER_DESTINATION_PRIVATE_H 21 | 22 | #include "poppler-global.h" 23 | #include "poppler-destination.h" 24 | 25 | #include "Object.h" 26 | 27 | class PDFDoc; 28 | class LinkDest; 29 | 30 | namespace poppler { 31 | 32 | class destination_private 33 | { 34 | public: 35 | destination_private(const LinkDest *ld, PDFDoc *doc); 36 | 37 | destination::type_enum type; 38 | bool page_number_unresolved; 39 | union { 40 | Ref page_ref; 41 | int page_number; 42 | }; 43 | double left, bottom; 44 | double right, top; 45 | double zoom; 46 | bool change_left : 1, change_top : 1; 47 | bool change_zoom : 1; 48 | 49 | PDFDoc *pdf_doc; 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/poppler-embedded-file-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009, 2011, Pino Toscano 3 | * Copyright (C) 2018, Albert Astals Cid 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef POPPLER_EMBEDDED_FILE_PRIVATE_H 21 | #define POPPLER_EMBEDDED_FILE_PRIVATE_H 22 | 23 | class FileSpec; 24 | 25 | namespace poppler { 26 | 27 | class embedded_file_private 28 | { 29 | public: 30 | embedded_file_private(FileSpec *fs); 31 | ~embedded_file_private(); 32 | 33 | embedded_file_private(const embedded_file_private &) = delete; 34 | embedded_file_private &operator=(const embedded_file_private &) = delete; 35 | 36 | static embedded_file *create(FileSpec *fs); 37 | 38 | FileSpec *file_spec; 39 | }; 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/poppler-embedded-file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2010, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef POPPLER_EMBEDDED_FILE_H 20 | #define POPPLER_EMBEDDED_FILE_H 21 | 22 | #include "poppler-global.h" 23 | 24 | #include 25 | 26 | namespace poppler { 27 | 28 | class embedded_file_private; 29 | 30 | class POPPLER_CPP_EXPORT embedded_file : public poppler::noncopyable 31 | { 32 | public: 33 | ~embedded_file(); 34 | 35 | bool is_valid() const; 36 | std::string name() const; 37 | ustring description() const; 38 | int size() const; 39 | time_type modification_date() const; 40 | time_type creation_date() const; 41 | byte_array checksum() const; 42 | std::string mime_type() const; 43 | byte_array data() const; 44 | 45 | private: 46 | embedded_file(embedded_file_private &dd); 47 | 48 | embedded_file_private *d; 49 | friend class embedded_file_private; 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/poppler-version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef POPPLER_VERSION_H 20 | #define POPPLER_VERSION_H 21 | 22 | #include "poppler-global.h" 23 | 24 | #define POPPLER_VERSION "@POPPLER_VERSION@" 25 | #define POPPLER_VERSION_MAJOR @POPPLER_MAJOR_VERSION@ 26 | #define POPPLER_VERSION_MINOR @POPPLER_MINOR_VERSION@ 27 | #define POPPLER_VERSION_MICRO @POPPLER_MICRO_VERSION@ 28 | 29 | namespace poppler 30 | { 31 | 32 | POPPLER_CPP_EXPORT std::string version_string(); 33 | POPPLER_CPP_EXPORT unsigned int version_major(); 34 | POPPLER_CPP_EXPORT unsigned int version_minor(); 35 | POPPLER_CPP_EXPORT unsigned int version_micro(); 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | ${CMAKE_CURRENT_SOURCE_DIR} 3 | ${CMAKE_CURRENT_SOURCE_DIR}/.. 4 | ${CMAKE_CURRENT_BINARY_DIR}/.. 5 | ${CMAKE_SOURCE_DIR}/utils 6 | ) 7 | 8 | macro(CPP_ADD_SIMPLETEST exe) 9 | string(REPLACE "-" "" test_name ${exe}) 10 | set(${test_name}_SOURCES 11 | ${ARGN} 12 | ) 13 | poppler_add_test(${exe} BUILD_CPP_TESTS ${${test_name}_SOURCES}) 14 | target_link_libraries(${exe} poppler-cpp poppler) 15 | if(MSVC) 16 | target_link_libraries(${exe} poppler ${poppler_LIBS}) 17 | endif() 18 | endmacro(CPP_ADD_SIMPLETEST) 19 | 20 | cpp_add_simpletest(poppler-dump poppler-dump.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc) 21 | cpp_add_simpletest(poppler-render poppler-render.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc) 22 | 23 | if(ENABLE_FUZZER) 24 | cpp_add_simpletest(doc_fuzzer ./fuzzing/doc_fuzzer.cc) 25 | cpp_add_simpletest(pdf_fuzzer ./fuzzing/pdf_fuzzer.cc) 26 | cpp_add_simpletest(pdf_file_fuzzer ./fuzzing/pdf_file_fuzzer.cc) 27 | cpp_add_simpletest(page_label_fuzzer ./fuzzing/page_label_fuzzer.cc) 28 | cpp_add_simpletest(page_search_fuzzer ./fuzzing/page_search_fuzzer.cc) 29 | endif() 30 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/tests/fuzzing/page_label_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "FuzzedDataProvider.h" 8 | 9 | const size_t input_size = 32; 10 | 11 | static void dummy_error_function(const std::string &, void *) { } 12 | 13 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 14 | { 15 | if (size < input_size) { 16 | return 0; 17 | } 18 | poppler::set_debug_error_function(dummy_error_function, nullptr); 19 | 20 | poppler::document *doc = poppler::document::load_from_raw_data((const char *)data, size); 21 | if (!doc || doc->is_locked()) { 22 | delete doc; 23 | return 0; 24 | } 25 | 26 | poppler::page_renderer r; 27 | FuzzedDataProvider data_provider(data, size); 28 | std::string in_label = data_provider.ConsumeBytesAsString(input_size); 29 | for (int i = 0; i < doc->pages(); i++) { 30 | poppler::page *p = doc->create_page(poppler::ustring::from_utf8(in_label.c_str(), -1)); 31 | if (!p) { 32 | continue; 33 | } 34 | r.render_page(p); 35 | p->label(); 36 | delete p; 37 | } 38 | 39 | delete doc; 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/tests/fuzzing/page_search_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "FuzzedDataProvider.h" 8 | 9 | const size_t input_size = 32; 10 | 11 | static void dummy_error_function(const std::string &, void *) { } 12 | 13 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 14 | { 15 | if (size < input_size) { 16 | return 0; 17 | } 18 | poppler::set_debug_error_function(dummy_error_function, nullptr); 19 | 20 | poppler::document *doc = poppler::document::load_from_raw_data((const char *)data, size); 21 | if (!doc || doc->is_locked()) { 22 | delete doc; 23 | return 0; 24 | } 25 | 26 | poppler::page_renderer r; 27 | FuzzedDataProvider data_provider(data, size); 28 | std::string in_text = data_provider.ConsumeBytesAsString(input_size); 29 | for (int i = 0; i < doc->pages(); i++) { 30 | poppler::page *p = doc->create_page(i); 31 | if (!p) { 32 | continue; 33 | } 34 | poppler::rectf rect = p->page_rect(); 35 | poppler::ustring text = poppler::ustring::from_utf8(in_text.c_str(), -1); 36 | p->search(text, rect, poppler::page::search_from_top, poppler::case_insensitive, poppler::rotate_0); 37 | r.render_page(p); 38 | delete p; 39 | } 40 | 41 | delete doc; 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/tests/fuzzing/pdf_file_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "fuzzer_temp_file.h" 8 | 9 | static void dummy_error_function(const std::string &, void *) { } 10 | 11 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 12 | { 13 | poppler::set_debug_error_function(dummy_error_function, nullptr); 14 | 15 | char *tmpfile = fuzzer_get_tmpfile(data, size); 16 | std::string fname(tmpfile); 17 | poppler::document *doc = poppler::document::load_from_file(fname); 18 | if (!doc || doc->is_locked()) { 19 | delete doc; 20 | fuzzer_release_tmpfile(tmpfile); 21 | return 0; 22 | } 23 | 24 | poppler::page_renderer r; 25 | for (int i = 0; i < doc->pages(); i++) { 26 | poppler::page *p = doc->create_page(i); 27 | if (!p) { 28 | continue; 29 | } 30 | r.render_page(p); 31 | delete p; 32 | } 33 | 34 | delete doc; 35 | fuzzer_release_tmpfile(tmpfile); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /poppler-20.12.1/cpp/tests/fuzzing/pdf_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static void dummy_error_function(const std::string &, void *) { } 9 | 10 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 11 | { 12 | poppler::set_debug_error_function(dummy_error_function, nullptr); 13 | 14 | poppler::document *doc = poppler::document::load_from_raw_data((const char *)data, size); 15 | if (!doc || doc->is_locked()) { 16 | delete doc; 17 | return 0; 18 | } 19 | doc->metadata(); 20 | doc->create_destination_map(); 21 | doc->embedded_files(); 22 | doc->fonts(); 23 | 24 | poppler::page_renderer r; 25 | for (int i = 0; i < doc->pages(); i++) { 26 | poppler::page *p = doc->create_page(i); 27 | if (!p) { 28 | continue; 29 | } 30 | r.render_page(p); 31 | p->text_list(poppler::page::text_list_include_font); 32 | delete p; 33 | } 34 | 35 | delete doc; 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | SYSTEM 3 | ${GTK3_INCLUDE_DIRS} 4 | ) 5 | 6 | add_definitions(${GTK3_CFLAGS_OTHER}) 7 | 8 | set(poppler_glib_demo_SRCS 9 | main.c 10 | find.c 11 | fonts.c 12 | forms.c 13 | info.cc 14 | images.c 15 | links.c 16 | outline.c 17 | page.c 18 | print.c 19 | render.c 20 | text.c 21 | transitions.c 22 | utils.c 23 | annots.c 24 | attachments.c 25 | layers.c 26 | selections.c 27 | taggedstruct.c 28 | ) 29 | poppler_add_test(poppler-glib-demo BUILD_GTK_TESTS ${poppler_glib_demo_SRCS}) 30 | 31 | if(${CMAKE_VERSION} VERSION_LESS "3.6.0") 32 | target_link_libraries(poppler-glib-demo ${CAIRO_LIBRARIES} poppler-glib ${GTK3_LIBRARIES}) 33 | else() 34 | target_link_libraries(poppler-glib-demo ${CAIRO_LIBRARIES} poppler-glib PkgConfig::GTK3) 35 | endif() 36 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/annots.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Inigo Martinez 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _ANNOTS_H_ 23 | # define _ANNOTS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_annots_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _ANNOTS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/attachments.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _ATTACHMENTS_H_ 23 | # define _ATTACHMENTS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_attachments_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _ATTACHMENTS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/find.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _FIND_H_ 23 | # define _FIND_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_find_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _FIND_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/fonts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _FONTS_H_ 23 | # define _FONTS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_fonts_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _FONTS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/forms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _FORMS_H_ 23 | # define _FORMS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_forms_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _FORMS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/images.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _IMAGES_H_ 23 | # define _IMAGES_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_images_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _IMAGES_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _INFO_H_ 23 | # define _INFO_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_info_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _INFO_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/layers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _LAYERS_H_ 23 | # define _LAYERS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_layers_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _LAYERS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/links.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _LINKS_H_ 23 | # define _LINKS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_links_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _LINKS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/outline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _OUTLINE_H_ 23 | # define _OUTLINE_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_outline_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _OUTLINE_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/page.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _PAGE_H_ 23 | # define _PAGE_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_page_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _PAGE_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _PRINT_H_ 23 | # define _PRINT_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_print_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _PRINT_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/render.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _RENDER_H_ 23 | # define _RENDER_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_render_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _RENDER_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/selections.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _SELECTIONS_H_ 23 | # define _SELECTIONS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_selections_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _SELECTIONS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/taggedstruct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Igalia S.L. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _TAGGEDSTRUCT_H_ 23 | # define _TAGGEDSTRUCT_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_taggedstruct_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _TAGGEDSTRUCT_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/text.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _TEXT_H_ 23 | # define _TEXT_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_text_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _TEXT_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/demo/transitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Carlos Garcia Campos 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef _TRANSITIONS_H_ 23 | # define _TRANSITIONS_H_ 24 | 25 | G_BEGIN_DECLS 26 | 27 | GtkWidget *pgd_transitions_create_widget(PopplerDocument *document); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* _TRANSITIONS_H_ */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/poppler-date.cc: -------------------------------------------------------------------------------- 1 | /* poppler-date.cc: glib interface to poppler 2 | * 3 | * Copyright (C) 2009 Carlos Garcia Campos 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "poppler-date.h" 24 | 25 | /** 26 | * poppler_date_parse: 27 | * @date: string to parse 28 | * @timet: an uninitialized #time_t 29 | * 30 | * Parses a PDF format date string and converts it to a #time_t. Returns #FALSE 31 | * if the parsing fails or the input string is not a valid PDF format date string 32 | * 33 | * Return value: #TRUE, if @timet was set 34 | * 35 | * Since: 0.12 36 | **/ 37 | gboolean poppler_date_parse(const gchar *date, time_t *timet) 38 | { 39 | time_t t; 40 | GooString dateString(date); 41 | t = dateStringToTime(&dateString); 42 | if (t == (time_t)-1) 43 | return FALSE; 44 | 45 | *timet = t; 46 | return TRUE; 47 | } 48 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/poppler-date.h: -------------------------------------------------------------------------------- 1 | /* poppler-date.h: glib interface to poppler 2 | * 3 | * Copyright (C) 2009 Carlos Garcia Campos 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __POPPLER_DATE_H__ 21 | #define __POPPLER_DATE_H__ 22 | 23 | #include "poppler.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | POPPLER_PUBLIC 28 | gboolean poppler_date_parse(const gchar *date, time_t *timet); 29 | 30 | G_END_DECLS 31 | 32 | #endif /* __POPPLER_DATE_H__ */ 33 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/poppler-enums.c.template: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #include 3 | 4 | #include "poppler-enums.h" 5 | 6 | /*** END file-header ***/ 7 | 8 | /*** BEGIN file-production ***/ 9 | /* enumerations from "@filename@" */ 10 | #include "@filename@" 11 | /*** END file-production ***/ 12 | 13 | 14 | /*** BEGIN value-header ***/ 15 | GType 16 | @enum_name@_get_type (void) 17 | { 18 | static volatile gsize g_define_type_id__volatile = 0; 19 | 20 | if (g_once_init_enter (&g_define_type_id__volatile)) { 21 | static const G@Type@Value values[] = { 22 | /*** END value-header ***/ 23 | 24 | /*** BEGIN value-production ***/ 25 | { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, 26 | /*** END value-production ***/ 27 | 28 | /*** BEGIN value-tail ***/ 29 | { 0, NULL, NULL } 30 | }; 31 | GType g_define_type_id = 32 | g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); 33 | 34 | g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); 35 | } 36 | 37 | return g_define_type_id__volatile; 38 | } 39 | 40 | /*** END value-tail ***/ 41 | 42 | /*** BEGIN file-tail ***/ 43 | 44 | /*** END file-tail ***/ 45 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/poppler-enums.h.template: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | 3 | #ifndef POPPLER_ENUMS_H 4 | #define POPPLER_ENUMS_H 5 | 6 | #include 7 | 8 | #include "poppler.h" 9 | 10 | G_BEGIN_DECLS 11 | /*** END file-header ***/ 12 | 13 | /*** BEGIN file-production ***/ 14 | 15 | /* enumerations from "@filename@" */ 16 | /*** END file-production ***/ 17 | 18 | /*** BEGIN value-header ***/ 19 | POPPLER_PUBLIC 20 | GType @enum_name@_get_type (void) G_GNUC_CONST; 21 | #define POPPLER_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) 22 | /*** END value-header ***/ 23 | 24 | /*** BEGIN file-tail ***/ 25 | G_END_DECLS 26 | 27 | #endif /* !POPPLER_ENUMS_H */ 28 | /*** END file-tail ***/ 29 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/poppler-macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Christian Persch 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef __POPPLER_MACROS_H__ 20 | #define __POPPLER_MACROS_H__ 21 | 22 | /** 23 | * POPPLER_PUBLIC: 24 | */ 25 | #if defined(_WIN32) 26 | # define POPPLER_PUBLIC __declspec(dllexport) 27 | #elif defined(__GNUC__) 28 | # define POPPLER_PUBLIC __attribute__((visibility("default"))) extern 29 | #else 30 | # define POPPLER_PUBLIC 31 | #endif 32 | 33 | #endif /* __POPPLER_MACROS_H__ */ 34 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_command( 2 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp 3 | DEPENDS poppler-glib 4 | COMMAND ${CMAKE_SOURCE_DIR}/make-glib-api-docs --src-dir=${CMAKE_SOURCE_DIR} --build-dir=${CMAKE_BINARY_DIR} 5 | COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp 6 | ) 7 | 8 | add_custom_target(glib-docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp) 9 | 10 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ 11 | DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/poppler" 12 | ) 13 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/html/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/html/home.png -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/html/left-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/html/left-insensitive.png -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/html/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/html/left.png -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/html/right-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/html/right-insensitive.png -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/html/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/html/right.png -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/html/up-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/html/up-insensitive.png -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/html/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/html/up.png -------------------------------------------------------------------------------- /poppler-20.12.1/glib/reference/poppler-overrides.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/poppler-20.12.1/glib/reference/poppler-overrides.txt -------------------------------------------------------------------------------- /poppler-20.12.1/glib/tests/check_text.c: -------------------------------------------------------------------------------- 1 | /* 2 | * testing program for the get_text function 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | /* 12 | * main 13 | */ 14 | int main(int argc, char *argv[]) 15 | { 16 | GFile *infile; 17 | PopplerDocument *doc; 18 | PopplerPage *page; 19 | int npages, n; 20 | char *text; 21 | GError *err = NULL; 22 | 23 | /* open file */ 24 | 25 | infile = g_file_new_for_path(TESTDATADIR "/unittestcases/WithActualText.pdf"); 26 | if (!infile) 27 | exit(EXIT_FAILURE); 28 | 29 | doc = poppler_document_new_from_gfile(infile, NULL, NULL, &err); 30 | if (doc == NULL) { 31 | g_printerr("error opening pdf file: %s\n", err->message); 32 | g_error_free(err); 33 | exit(EXIT_FAILURE); 34 | } 35 | 36 | /* pages */ 37 | 38 | npages = poppler_document_get_n_pages(doc); 39 | if (npages < 1) { 40 | g_printerr("no page in document\n"); 41 | exit(EXIT_FAILURE); 42 | } 43 | 44 | /* check text */ 45 | 46 | n = 0; 47 | page = poppler_document_get_page(doc, n); 48 | text = poppler_page_get_text(page); 49 | g_print("%s\n", text); 50 | g_assert_cmpstr(text, ==, "The slow brown fox jumps over the black dog."); 51 | g_object_unref(page); 52 | 53 | return EXIT_SUCCESS; 54 | } 55 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/tests/fuzzing/doc_attr_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 7 | { 8 | GError *err = NULL; 9 | PopplerDocument *doc; 10 | PopplerPage *page; 11 | char *buf; 12 | int npages, n; 13 | 14 | doc = poppler_document_new_from_data((char *)data, size, NULL, &err); 15 | if (doc == NULL) { 16 | g_error_free(err); 17 | return 0; 18 | } 19 | 20 | buf = (char *)calloc(size + 1, sizeof(char)); 21 | memcpy(buf, data, size); 22 | buf[size] = '\0'; 23 | 24 | poppler_document_set_author(doc, buf); 25 | poppler_document_set_creator(doc, buf); 26 | poppler_document_set_keywords(doc, buf); 27 | poppler_document_set_producer(doc, buf); 28 | poppler_document_set_subject(doc, buf); 29 | poppler_document_set_title(doc, buf); 30 | 31 | free(buf); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/tests/fuzzing/find_text_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 7 | { 8 | GError *err = NULL; 9 | PopplerDocument *doc; 10 | PopplerPage *page; 11 | char *buf; 12 | int npages; 13 | 14 | doc = poppler_document_new_from_data((char *)data, size, NULL, &err); 15 | if (doc == NULL) { 16 | g_error_free(err); 17 | return 0; 18 | } 19 | 20 | npages = poppler_document_get_n_pages(doc); 21 | if (npages < 1) { 22 | return 0; 23 | } 24 | 25 | buf = (char *)calloc(size + 1, sizeof(char)); 26 | memcpy(buf, data, size); 27 | buf[size] = '\0'; 28 | 29 | for (int n = 0; n < npages; n++) { 30 | page = poppler_document_get_page(doc, n); 31 | if (!page) { 32 | continue; 33 | } 34 | poppler_page_find_text(page, buf); 35 | g_object_unref(page); 36 | } 37 | free(buf); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/tests/fuzzing/label_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 7 | { 8 | GError *err = NULL; 9 | PopplerDocument *doc; 10 | PopplerPage *page; 11 | char *buf; 12 | int npages; 13 | 14 | doc = poppler_document_new_from_data((char *)data, size, NULL, &err); 15 | if (doc == NULL) { 16 | g_error_free(err); 17 | return 0; 18 | } 19 | 20 | npages = poppler_document_get_n_pages(doc); 21 | if (npages < 1) { 22 | return 0; 23 | } 24 | 25 | buf = (char *)calloc(size + 1, sizeof(char)); 26 | memcpy(buf, data, size); 27 | buf[size] = '\0'; 28 | 29 | for (int n = 0; n < npages; n++) { 30 | page = poppler_document_get_page_by_label(doc, buf); 31 | if (!page) { 32 | continue; 33 | } 34 | g_object_unref(page); 35 | } 36 | free(buf); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /poppler-20.12.1/glib/tests/fuzzing/util_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 7 | { 8 | char *tmp_ch; 9 | char *buf; 10 | gsize length; 11 | guint8 *tmp_uint; 12 | 13 | buf = (char *)calloc(size + 1, sizeof(char)); 14 | memcpy(buf, data, size); 15 | buf[size] = '\0'; 16 | 17 | tmp_ch = poppler_named_dest_from_bytestring((const guint8 *)buf, size); 18 | tmp_uint = poppler_named_dest_to_bytestring(buf, &length); 19 | 20 | g_free(tmp_ch); 21 | g_free(tmp_uint); 22 | free(buf); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/GooLikely.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // GooLikely.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright (C) 2008 Kees Cook 8 | // 9 | //======================================================================== 10 | 11 | #ifndef GOOLIKELY_H 12 | #define GOOLIKELY_H 13 | 14 | #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) 15 | # define likely(x) __builtin_expect((x), 1) 16 | # define unlikely(x) __builtin_expect((x), 0) 17 | #else 18 | # define likely(x) (x) 19 | # define unlikely(x) (x) 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/GooTimer.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // GooTimer.cc 4 | // 5 | // This file is licensed under GPLv2 or later 6 | // 7 | // Copyright 2005 Jonathan Blandford 8 | // Copyright 2007 Krzysztof Kowalczyk 9 | // Copyright 2010 Hib Eris 10 | // Copyright 2011 Albert Astals cid 11 | // Copyright 2014 Bogdan Cristea 12 | // Copyright 2014 Peter Breitenlohner 13 | // Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team 14 | // 15 | //======================================================================== 16 | 17 | #ifndef GOOTIMER_H 18 | #define GOOTIMER_H 19 | 20 | #include "poppler-config.h" 21 | #ifdef HAVE_GETTIMEOFDAY 22 | # include 23 | #endif 24 | 25 | #ifdef _WIN32 26 | # ifndef NOMINMAX 27 | # define NOMINMAX 28 | # endif 29 | # include 30 | #endif 31 | 32 | //------------------------------------------------------------------------ 33 | // GooTimer 34 | //------------------------------------------------------------------------ 35 | 36 | class GooTimer 37 | { 38 | public: 39 | // Create a new timer. 40 | GooTimer(); 41 | 42 | void start(); 43 | void stop(); 44 | double getElapsed(); 45 | 46 | private: 47 | #ifdef HAVE_GETTIMEOFDAY 48 | struct timeval start_time; 49 | struct timeval end_time; 50 | #elif defined(_WIN32) 51 | LARGE_INTEGER start_time; 52 | LARGE_INTEGER end_time; 53 | #endif 54 | bool active; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/ImgWriter.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // ImgWriter.cpp 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright (C) 2009 Albert Astals Cid 8 | // 9 | //======================================================================== 10 | 11 | #include "ImgWriter.h" 12 | 13 | ImgWriter::~ImgWriter() { } 14 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/ImgWriter.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // ImgWriter.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright (C) 2009 Stefan Thomas 8 | // Copyright (C) 2009, 2011, 2018 Albert Astals Cid 9 | // Copyright (C) 2010 Adrian Johnson 10 | // Copyright (C) 2010 Brian Cameron 11 | // Copyright (C) 2011 Thomas Freitag 12 | // 13 | //======================================================================== 14 | 15 | #ifndef IMGWRITER_H 16 | #define IMGWRITER_H 17 | 18 | #include 19 | 20 | class ImgWriter 21 | { 22 | public: 23 | ImgWriter() = default; 24 | ImgWriter(const ImgWriter &) = delete; 25 | ImgWriter &operator=(const ImgWriter &other) = delete; 26 | 27 | virtual ~ImgWriter(); 28 | virtual bool init(FILE *f, int width, int height, int hDPI, int vDPI) = 0; 29 | 30 | virtual bool writePointers(unsigned char **rowPointers, int rowCount) = 0; 31 | virtual bool writeRow(unsigned char **row) = 0; 32 | 33 | virtual bool close() = 0; 34 | virtual bool supportCMYK() { return false; } 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/NetPBMWriter.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // NetPBMWriter.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright (C) 2009 Stefan Thomas 8 | // Copyright (C) 2009, 2011 Albert Astals Cid 9 | // Copyright (C) 2010, 2013 Adrian Johnson 10 | // Copyright (C) 2010 Brian Cameron 11 | // Copyright (C) 2011 Thomas Freitag 12 | // 13 | //======================================================================== 14 | 15 | #ifndef NETPBMWRITER_H 16 | #define NETPBMWRITER_H 17 | 18 | #include "poppler-config.h" 19 | 20 | #include "ImgWriter.h" 21 | 22 | // Writer for the NetPBM formats (PBM and PPM) 23 | // This format is documented at: 24 | // http://netpbm.sourceforge.net/doc/pbm.html 25 | // http://netpbm.sourceforge.net/doc/ppm.html 26 | 27 | class NetPBMWriter : public ImgWriter 28 | { 29 | public: 30 | /* RGB - 3 bytes/pixel 31 | * MONOCHROME - 8 pixels/byte 32 | */ 33 | enum Format 34 | { 35 | RGB, 36 | MONOCHROME 37 | }; 38 | 39 | NetPBMWriter(Format formatA = RGB); 40 | ~NetPBMWriter() override {}; 41 | 42 | bool init(FILE *f, int width, int height, int hDPI, int vDPI) override; 43 | 44 | bool writePointers(unsigned char **rowPointers, int rowCount) override; 45 | bool writeRow(unsigned char **row) override; 46 | 47 | bool close() override; 48 | 49 | private: 50 | FILE *file; 51 | Format format; 52 | int width; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/gbase64.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // gbase64.h 4 | // 5 | // Implementation of a base64 encoder, because another one did not immediately 6 | // avail itself. 7 | // 8 | // This file is licensed under the GPLv2 or later 9 | // 10 | // Copyright (C) 2018 Greg Knight 11 | // Copyright (C) 2019 Albert Astals Cid 12 | // 13 | //======================================================================== 14 | 15 | #ifndef GOO_GBASE64_H 16 | #define GOO_GBASE64_H 17 | 18 | #include 19 | #include 20 | 21 | std::string gbase64Encode(const void *input, size_t len); 22 | 23 | inline std::string gbase64Encode(const std::vector &input) 24 | { 25 | return input.empty() ? std::string() : gbase64Encode(&input[0], input.size()); 26 | } 27 | 28 | inline std::string gbase64Encode(const std::vector &input) 29 | { 30 | return input.empty() ? std::string() : gbase64Encode(&input[0], input.size()); 31 | } 32 | 33 | #endif // ndef GOO_GBASE64_H 34 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/gbasename.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // gbasename.h 4 | // 5 | // Wrapper for libgen's basename() call which returns a std::string. 6 | // This is a convenience method working around questionable behavior 7 | // in the copy of basename() provided by libgen.h. 8 | // 9 | // This file is licensed under the GPLv2 or later 10 | // 11 | // Copyright (C) 2018 Greg Knight 12 | // Copyright (C) 2019 Albert Astals Cid 13 | // 14 | //======================================================================== 15 | 16 | #ifndef GBASENAME_H 17 | #define GBASENAME_H 18 | 19 | #include 20 | 21 | std::string gbasename(const char *filename); 22 | 23 | #endif // ndef GBASENAME_H 24 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/glibc.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // glibc.h 4 | // 5 | // Emulate various non-portable glibc functions. 6 | // 7 | // This file is licensed under the GPLv2 or later 8 | // 9 | // Copyright (C) 2016 Adrian Johnson 10 | // 11 | //======================================================================== 12 | 13 | #include "glibc.h" 14 | 15 | #ifndef HAVE_GMTIME_R 16 | struct tm *gmtime_r(const time_t *timep, struct tm *result) 17 | { 18 | struct tm *gt; 19 | gt = gmtime(timep); 20 | if (gt) 21 | *result = *gt; 22 | return gt; 23 | } 24 | #endif 25 | 26 | #ifndef HAVE_LOCALTIME_R 27 | struct tm *localtime_r(const time_t *timep, struct tm *result) 28 | { 29 | struct tm *lt; 30 | lt = localtime(timep); 31 | *result = *lt; 32 | return lt; 33 | } 34 | #endif 35 | 36 | #ifndef HAVE_TIMEGM 37 | // Get offset of local time from UTC in seconds. DST is ignored. 38 | static time_t getLocalTimeZoneOffset() 39 | { 40 | time_t utc, local; 41 | struct tm tm_utc; 42 | time(&utc); 43 | gmtime_r(&utc, &tm_utc); 44 | local = mktime(&tm_utc); 45 | return difftime(utc, local); 46 | } 47 | 48 | time_t timegm(struct tm *tm) 49 | { 50 | tm->tm_isdst = 0; 51 | time_t t = mktime(tm); 52 | if (t == -1) 53 | return t; 54 | 55 | t += getLocalTimeZoneOffset(); 56 | return t; 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/glibc.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // glibc.h 4 | // 5 | // Emulate various non-portable glibc functions. 6 | // 7 | // This file is licensed under the GPLv2 or later 8 | // 9 | // Copyright (C) 2016, 2017 Adrian Johnson 10 | // Copyright (C) 2017 Albert Astals Cid 11 | // 12 | //======================================================================== 13 | 14 | #ifndef GLIBC_H 15 | #define GLIBC_H 16 | 17 | #include "config.h" 18 | 19 | #include 20 | 21 | #ifndef HAVE_GMTIME_R 22 | struct tm *gmtime_r(const time_t *timep, struct tm *result); 23 | #endif 24 | 25 | #ifndef HAVE_LOCALTIME_R 26 | struct tm *localtime_r(const time_t *timep, struct tm *result); 27 | #endif 28 | 29 | #ifndef HAVE_TIMEGM 30 | time_t timegm(struct tm *tm); 31 | #endif 32 | 33 | #ifndef HAVE_STRTOK_R 34 | char *strtok_r(char *s, const char *delim, char **save_ptr); 35 | #endif 36 | 37 | #endif // GLIBC_H 38 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/grandom.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * grandom.cc 3 | * 4 | * This file is licensed under the GPLv2 or later 5 | * 6 | * Pseudo-random number generation 7 | * 8 | * Copyright (C) 2012 Fabio D'Urso 9 | * Copyright (C) 2018 Adam Reichold 10 | */ 11 | 12 | #include "grandom.h" 13 | 14 | #include 15 | 16 | namespace { 17 | 18 | auto &grandom_engine() 19 | { 20 | static thread_local std::default_random_engine engine { std::random_device {}() }; 21 | return engine; 22 | } 23 | 24 | } 25 | 26 | void grandom_fill(unsigned char *buff, int size) 27 | { 28 | auto &engine = grandom_engine(); 29 | std::uniform_int_distribution distribution { std::numeric_limits::min(), std::numeric_limits::max() }; 30 | for (int index = 0; index < size; ++index) { 31 | buff[index] = distribution(engine); 32 | } 33 | } 34 | 35 | double grandom_double() 36 | { 37 | auto &engine = grandom_engine(); 38 | return std::generate_canonical::digits>(engine); 39 | } 40 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/grandom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * grandom.h 3 | * 4 | * This file is licensed under the GPLv2 or later 5 | * 6 | * Pseudo-random number generation 7 | * 8 | * Copyright (C) 2012 Fabio D'Urso 9 | * Copyright (C) 2018 Adam Reichold 10 | */ 11 | 12 | #ifndef GRANDOM_H 13 | #define GRANDOM_H 14 | 15 | /// Fills the given buffer with random bytes 16 | void grandom_fill(unsigned char *buff, int size); 17 | 18 | /// Returns a random number in [0,1) 19 | double grandom_double(); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /poppler-20.12.1/goo/gstrtod.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Libspectre. 2 | * 3 | * Copyright (C) 2007 Albert Astals Cid 4 | * Copyright (C) 2007 Carlos Garcia Campos 5 | * 6 | * Libspectre 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 | * Libspectre 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 | /* This function comes from spectre-utils from libspectre */ 22 | 23 | #ifndef GSTRTOD_H 24 | #define GSTRTOD_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* This function behaves like the standard atof()/(strtod() function 31 | * does in the C locale. It does this without actually changing 32 | * the current locale, since that would not be thread-safe. 33 | * A limitation of the implementation is that this function 34 | * will still accept localized versions of infinities and NANs. 35 | */ 36 | double gatof(const char *nptr); 37 | double gstrtod(const char *nptr, char **endptr); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | readonly output=$(git clang-format -v --diff) 4 | 5 | if [[ "$output" == *"no modified files to format"* ]]; then exit 0; fi 6 | if [[ "$output" == *"clang-format did not modify any files"* ]]; then exit 0; fi 7 | 8 | echo "ERROR: you need to run git clang-format on your commit" 9 | echo " git clang-format -f is potentially what you want" 10 | exit 1 11 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler-cpp.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | 5 | Name: poppler-cpp 6 | Description: cpp backend for Poppler PDF rendering library 7 | Version: @POPPLER_VERSION@ 8 | Requires: @PC_REQUIRES@ 9 | @PC_REQUIRES_PRIVATE@ 10 | 11 | Libs: -L${libdir} -lpoppler-cpp 12 | Cflags: -I${includedir}/poppler/cpp 13 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler-glib.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | 5 | Name: poppler-glib 6 | Description: GLib wrapper for poppler 7 | Version: @POPPLER_VERSION@ 8 | Requires: glib-2.0 >= @GLIB_REQUIRED@ gobject-2.0 >= @GLIB_REQUIRED@ cairo >= @CAIRO_VERSION@ @PC_REQUIRES@ 9 | @PC_REQUIRES_PRIVATE@ 10 | 11 | Libs: -L${libdir} -lpoppler-glib 12 | Cflags: -I${includedir}/poppler/glib 13 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler-qt5.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | 5 | Name: poppler-qt5 6 | Description: Qt5 bindings for poppler 7 | Version: @POPPLER_VERSION@ 8 | Requires: @PC_REQUIRES@ 9 | @PC_REQUIRES_PRIVATE@ 10 | 11 | Libs: -L${libdir} -lpoppler-qt5 12 | Cflags: -I${includedir}/poppler/qt5 13 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | 5 | Name: poppler 6 | Description: PDF rendering library 7 | Version: @POPPLER_VERSION@ 8 | 9 | Libs: -L${libdir} -lpoppler 10 | Cflags: -I${includedir}/poppler 11 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/BuiltinFontWidth.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // BuiltinFontWidth.h 4 | // 5 | // Copyright 2001-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) 2020 Albert Astals Cid 17 | // 18 | // To see a description of the changes please see the Changelog file that 19 | // came with your tarball or type make ChangeLog if you are building from git 20 | // 21 | //======================================================================== 22 | 23 | #ifndef BUILTINFONTWIDTH_H 24 | #define BUILTINFONTWIDTH_H 25 | 26 | struct BuiltinFontWidth 27 | { 28 | const char *name; 29 | unsigned short width; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/CharTypes.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // CharTypes.h 4 | // 5 | // Copyright 2001-2003 Glyph & Cog, LLC 6 | // 7 | //======================================================================== 8 | 9 | #ifndef CHARTYPES_H 10 | #define CHARTYPES_H 11 | 12 | // Unicode character. 13 | typedef unsigned int Unicode; 14 | 15 | // Character ID for CID character collections. 16 | typedef unsigned int CID; 17 | 18 | // This is large enough to hold any of the following: 19 | // - 8-bit char code 20 | // - 16-bit CID 21 | // - Unicode 22 | typedef unsigned int CharCode; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/CurlCachedFile.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // CurlCachedFile.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #ifndef CURLCACHELOADER_H 13 | #define CURLCACHELOADER_H 14 | 15 | #include "poppler-config.h" 16 | #include "CachedFile.h" 17 | 18 | #include 19 | 20 | //------------------------------------------------------------------------ 21 | 22 | class CurlCachedFileLoader : public CachedFileLoader 23 | { 24 | 25 | public: 26 | CurlCachedFileLoader(); 27 | ~CurlCachedFileLoader() override; 28 | size_t init(GooString *url, CachedFile *cachedFile) override; 29 | int load(const std::vector &ranges, CachedFileWriter *writer) override; 30 | 31 | private: 32 | GooString *url; 33 | CachedFile *cachedFile; 34 | CURL *curl; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/CurlPDFDocBuilder.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // CurlPDFDocBuilder.cc 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010, 2017 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #include 13 | 14 | #include "CurlPDFDocBuilder.h" 15 | 16 | #include "CachedFile.h" 17 | #include "CurlCachedFile.h" 18 | #include "ErrorCodes.h" 19 | 20 | //------------------------------------------------------------------------ 21 | // CurlPDFDocBuilder 22 | //------------------------------------------------------------------------ 23 | 24 | PDFDoc *CurlPDFDocBuilder::buildPDFDoc(const GooString &uri, GooString *ownerPassword, GooString *userPassword, void *guiDataA) 25 | { 26 | CachedFile *cachedFile = new CachedFile(new CurlCachedFileLoader(), uri.copy()); 27 | 28 | if (cachedFile->getLength() == ((unsigned int)-1)) { 29 | cachedFile->decRefCnt(); 30 | return PDFDoc::ErrorPDFDoc(errOpenFile, uri.copy()); 31 | } 32 | 33 | BaseStream *str = new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull)); 34 | 35 | return new PDFDoc(str, ownerPassword, userPassword, guiDataA); 36 | } 37 | 38 | bool CurlPDFDocBuilder::supports(const GooString &uri) 39 | { 40 | if (uri.cmpN("http://", 7) == 0 || uri.cmpN("https://", 8) == 0) { 41 | return true; 42 | } else { 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/CurlPDFDocBuilder.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // CurlPDFDocBuilder.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010, 2018 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #ifndef CURLPDFDOCBUILDER_H 13 | #define CURLPDFDOCBUILDER_H 14 | 15 | #include "PDFDocBuilder.h" 16 | 17 | //------------------------------------------------------------------------ 18 | // CurlPDFDocBuilder 19 | // 20 | // The CurlPDFDocBuilder implements a PDFDocBuilder for 'http(s)://'. 21 | //------------------------------------------------------------------------ 22 | 23 | class CurlPDFDocBuilder : public PDFDocBuilder 24 | { 25 | 26 | public: 27 | PDFDoc *buildPDFDoc(const GooString &uri, GooString *ownerPassword = nullptr, GooString *userPassword = nullptr, void *guiDataA = nullptr) override; 28 | bool supports(const GooString &uri) override; 29 | }; 30 | 31 | #endif /* CURLPDFDOCBUILDER_H */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/DateInfo.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // DateInfo.h 4 | // 5 | // Copyright (C) 2008, 2018, 2019 Albert Astals Cid 6 | // Copyright (C) 2009 Carlos Garcia Campos 7 | // Copyright (C) 2015 André Guerreiro 8 | // Copyright (C) 2015 André Esser 9 | // Copyright (C) 2016 Adrian Johnson 10 | // 11 | // To see a description of the changes please see the Changelog file that 12 | // came with your tarball or type make ChangeLog if you are building from git 13 | // 14 | //======================================================================== 15 | 16 | //======================================================================== 17 | // 18 | // Based on code from pdfinfo.cc 19 | // 20 | // Copyright 1998-2003 Glyph & Cog, LLC 21 | // 22 | //======================================================================== 23 | 24 | #ifndef DATE_INFO_H 25 | #define DATE_INFO_H 26 | 27 | #include "goo/GooString.h" 28 | #include 29 | 30 | bool parseDateString(const char *string, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute); 31 | 32 | /* Converts the time_t into a PDF Date format string. 33 | * If timeA is NULL, current time is used. 34 | * Returns new GooString. Free with delete. 35 | */ 36 | GooString *timeToDateString(const time_t *timeA); 37 | 38 | /* Convert PDF date string to time. 39 | * Returns -1 if conversion fails. 40 | */ 41 | time_t dateStringToTime(const GooString *dateString); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/FontEncodingTables.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // FontEncodingTables.h 4 | // 5 | // Copyright 2001-2003 Glyph & Cog, LLC 6 | // 7 | //======================================================================== 8 | 9 | #ifndef FONTENCODINGTABLES_H 10 | #define FONTENCODINGTABLES_H 11 | 12 | extern const char *macRomanEncoding[]; 13 | extern const char *macExpertEncoding[]; 14 | extern const char *winAnsiEncoding[]; 15 | extern const char *standardEncoding[]; 16 | extern const char *expertEncoding[]; 17 | extern const char *symbolEncoding[]; 18 | extern const char *zapfDingbatsEncoding[]; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/Linearization.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // Linearization.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2019 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #ifndef LINEARIZATION_H 13 | #define LINEARIZATION_H 14 | 15 | #include "Object.h" 16 | class BaseStream; 17 | 18 | //------------------------------------------------------------------------ 19 | // Linearization 20 | //------------------------------------------------------------------------ 21 | 22 | class Linearization 23 | { 24 | public: 25 | Linearization(BaseStream *str); 26 | ~Linearization(); 27 | 28 | unsigned int getLength() const; 29 | unsigned int getHintsOffset() const; 30 | unsigned int getHintsLength() const; 31 | unsigned int getHintsOffset2() const; 32 | unsigned int getHintsLength2() const; 33 | int getObjectNumberFirst() const; 34 | unsigned int getEndFirst() const; 35 | int getNumPages() const; 36 | unsigned int getMainXRefEntriesOffset() const; 37 | int getPageFirst() const; 38 | 39 | private: 40 | Object linDict; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/LocalPDFDocBuilder.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // LocalPDFDocBuilder.cc 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #include 13 | 14 | #include "LocalPDFDocBuilder.h" 15 | 16 | //------------------------------------------------------------------------ 17 | // LocalPDFDocBuilder 18 | //------------------------------------------------------------------------ 19 | 20 | PDFDoc *LocalPDFDocBuilder::buildPDFDoc(const GooString &uri, GooString *ownerPassword, GooString *userPassword, void *guiDataA) 21 | { 22 | if (uri.cmpN("file://", 7) == 0) { 23 | GooString *fileName = uri.copy(); 24 | fileName->del(0, 7); 25 | return new PDFDoc(fileName, ownerPassword, userPassword, guiDataA); 26 | } else { 27 | GooString *fileName = uri.copy(); 28 | return new PDFDoc(fileName, ownerPassword, userPassword, guiDataA); 29 | } 30 | } 31 | 32 | bool LocalPDFDocBuilder::supports(const GooString &uri) 33 | { 34 | if (uri.cmpN("file://", 7) == 0) { 35 | return true; 36 | } else if (!strstr(uri.c_str(), "://")) { 37 | return true; 38 | } else { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/LocalPDFDocBuilder.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // LocalPDFDocBuilder.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010, 2018 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #ifndef LOCALPDFDOCBUILDER_H 13 | #define LOCALPDFDOCBUILDER_H 14 | 15 | #include "PDFDocBuilder.h" 16 | 17 | //------------------------------------------------------------------------ 18 | // LocalPDFDocBuilder 19 | // 20 | // The LocalPDFDocBuilder implements a PDFDocBuilder for local files. 21 | //------------------------------------------------------------------------ 22 | 23 | class LocalPDFDocBuilder : public PDFDocBuilder 24 | { 25 | 26 | public: 27 | PDFDoc *buildPDFDoc(const GooString &uri, GooString *ownerPassword = nullptr, GooString *userPassword = nullptr, void *guiDataA = nullptr) override; 28 | bool supports(const GooString &uri) override; 29 | }; 30 | 31 | #endif /* LOCALPDFDOCBUILDER_H */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/NameToCharCode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // NameToCharCode.h 4 | // 5 | // Copyright 2001-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) 2018, 2019 Albert Astals Cid 17 | // 18 | // To see a description of the changes please see the Changelog file that 19 | // came with your tarball or type make ChangeLog if you are building from git 20 | // 21 | //======================================================================== 22 | 23 | #ifndef NAMETOCHARCODE_H 24 | #define NAMETOCHARCODE_H 25 | 26 | #include "CharTypes.h" 27 | 28 | struct NameToCharCodeEntry; 29 | 30 | //------------------------------------------------------------------------ 31 | 32 | class NameToCharCode 33 | { 34 | public: 35 | NameToCharCode(); 36 | ~NameToCharCode(); 37 | 38 | NameToCharCode(const NameToCharCode &) = delete; 39 | NameToCharCode &operator=(const NameToCharCode &) = delete; 40 | 41 | void add(const char *name, CharCode c); 42 | CharCode lookup(const char *name) const; 43 | 44 | private: 45 | int hash(const char *name) const; 46 | 47 | NameToCharCodeEntry *tab; 48 | int size; 49 | int len; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/PDFDocBuilder.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // PDFDocBuilder.cc 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2020 Albert Astals Cid 8 | // 9 | //======================================================================== 10 | 11 | #include "PDFDocBuilder.h" 12 | 13 | PDFDocBuilder::~PDFDocBuilder() = default; 14 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/PDFDocBuilder.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // PDFDocBuilder.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010, 2018, 2020 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #ifndef PDFDOCBUILDER_H 13 | #define PDFDOCBUILDER_H 14 | 15 | #include "PDFDoc.h" 16 | class GooString; 17 | 18 | //------------------------------------------------------------------------ 19 | // PDFDocBuilder 20 | // 21 | // PDFDocBuilder is an abstract class that specifies the interface for 22 | // constructing PDFDocs. 23 | //------------------------------------------------------------------------ 24 | 25 | class PDFDocBuilder 26 | { 27 | 28 | public: 29 | PDFDocBuilder() = default; 30 | virtual ~PDFDocBuilder(); 31 | 32 | PDFDocBuilder(const PDFDocBuilder &) = delete; 33 | PDFDocBuilder &operator=(const PDFDocBuilder &) = delete; 34 | 35 | // Builds a new PDFDoc. Returns a PDFDoc. You should check this PDFDoc 36 | // with PDFDoc::isOk() for failures. 37 | // The caller is responsible for deleting ownerPassword, userPassWord and guiData. 38 | virtual PDFDoc *buildPDFDoc(const GooString &uri, GooString *ownerPassword = nullptr, GooString *userPassword = nullptr, void *guiDataA = nullptr) = 0; 39 | 40 | // Returns true if the builder supports building a PDFDoc from the URI. 41 | virtual bool supports(const GooString &uri) = 0; 42 | }; 43 | 44 | #endif /* PDFDOCBUILDER_H */ 45 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/PDFDocEncoding.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // PDFDocEncoding.h 4 | // 5 | // Copyright 2002-2003 Glyph & Cog, LLC 6 | // 7 | //======================================================================== 8 | 9 | //======================================================================== 10 | // 11 | // Modified under the Poppler project - http://poppler.freedesktop.org 12 | // 13 | // All changes made under the Poppler project to this file are licensed 14 | // under GPL version 2 or later 15 | // 16 | // Copyright (C) 2007 Adrian Johnson 17 | // Copyright (C) 2019 Volker Krause 18 | // Copyright (C) 2020 Oliver Sander 19 | // 20 | // To see a description of the changes please see the Changelog file that 21 | // came with your tarball or type make ChangeLog if you are building from git 22 | // 23 | //======================================================================== 24 | 25 | #ifndef PDFDOCENCODING_H 26 | #define PDFDOCENCODING_H 27 | 28 | #include 29 | 30 | #include "CharTypes.h" 31 | 32 | class GooString; 33 | 34 | extern const Unicode pdfDocEncoding[256]; 35 | 36 | char *pdfDocEncodingToUTF16(const std::string &orig, int *length); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/PSTokenizer.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // PSTokenizer.h 4 | // 5 | // Copyright 2002-2003 Glyph & Cog, LLC 6 | // 7 | //======================================================================== 8 | 9 | //======================================================================== 10 | // 11 | // Modified under the Poppler project - http://poppler.freedesktop.org 12 | // 13 | // All changes made under the Poppler project to this file are licensed 14 | // under GPL version 2 or later 15 | // 16 | // Copyright (C) 2006 Scott Turner 17 | // 18 | // To see a description of the changes please see the Changelog file that 19 | // came with your tarball or type make ChangeLog if you are building from git 20 | // 21 | //======================================================================== 22 | 23 | #ifndef PSTOKENIZER_H 24 | #define PSTOKENIZER_H 25 | 26 | //------------------------------------------------------------------------ 27 | 28 | class PSTokenizer 29 | { 30 | public: 31 | PSTokenizer(int (*getCharFuncA)(void *), void *dataA); 32 | ~PSTokenizer(); 33 | 34 | // Get the next PostScript token. Returns false at end-of-stream. 35 | bool getToken(char *buf, int size, int *length); 36 | 37 | private: 38 | int lookChar(); 39 | void consumeChar(); 40 | int getChar(); 41 | 42 | int (*getCharFunc)(void *); 43 | void *data; 44 | int charBuf; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/ProfileData.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // ProfileData.cc 4 | // 5 | // Copyright 2005 Jonathan Blandford 6 | // Copyright 2018 Adam Reichold 7 | // 8 | //======================================================================== 9 | 10 | #include 11 | 12 | #include "ProfileData.h" 13 | 14 | //------------------------------------------------------------------------ 15 | // ProfileData 16 | //------------------------------------------------------------------------ 17 | 18 | void ProfileData::addElement(double elapsed) 19 | { 20 | if (count == 0) { 21 | min = elapsed; 22 | max = elapsed; 23 | } else { 24 | if (elapsed < min) 25 | min = elapsed; 26 | if (elapsed > max) 27 | max = elapsed; 28 | } 29 | total += elapsed; 30 | count++; 31 | } 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/ProfileData.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // ProfileData.h 4 | // 5 | // Copyright 2005 Jonathan Blandford 6 | // Copyright 2018 Adam Reichold 7 | // 8 | //======================================================================== 9 | 10 | #ifndef PROFILE_DATA_H 11 | #define PROFILE_DATA_H 12 | 13 | //------------------------------------------------------------------------ 14 | // ProfileData 15 | //------------------------------------------------------------------------ 16 | 17 | class ProfileData 18 | { 19 | public: 20 | void addElement(double elapsed); 21 | 22 | int getCount() const { return count; } 23 | double getTotal() const { return total; } 24 | double getMin() const { return max; } 25 | double getMax() const { return max; } 26 | 27 | private: 28 | int count = 0; // size of array 29 | double total = 0.0; // number of elements in array 30 | double min = 0.0; // reference count 31 | double max = 0.0; // reference count 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/StdinCachedFile.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // StdinCachedFile.cc 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010 Albert Astals Cid 9 | // Copyright 2010 Jonathan Liu 10 | // 11 | //======================================================================== 12 | 13 | #include 14 | 15 | #include "StdinCachedFile.h" 16 | 17 | #ifdef _WIN32 18 | # include // for O_BINARY 19 | # include // for setmode 20 | #endif 21 | #include 22 | 23 | size_t StdinCacheLoader::init(GooString *dummy, CachedFile *cachedFile) 24 | { 25 | size_t read, size = 0; 26 | char buf[CachedFileChunkSize]; 27 | 28 | #ifdef _WIN32 29 | setmode(fileno(stdin), O_BINARY); 30 | #endif 31 | 32 | CachedFileWriter writer = CachedFileWriter(cachedFile, nullptr); 33 | do { 34 | read = fread(buf, 1, CachedFileChunkSize, stdin); 35 | (writer.write)(buf, CachedFileChunkSize); 36 | size += read; 37 | } while (read == CachedFileChunkSize); 38 | 39 | return size; 40 | } 41 | 42 | int StdinCacheLoader::load(const std::vector &ranges, CachedFileWriter *writer) 43 | { 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/StdinCachedFile.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // StdinCachedFile.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #ifndef STDINCACHELOADER_H 13 | #define STDINCACHELOADER_H 14 | 15 | #include "CachedFile.h" 16 | 17 | class StdinCacheLoader : public CachedFileLoader 18 | { 19 | 20 | public: 21 | size_t init(GooString *dummy, CachedFile *cachedFile) override; 22 | int load(const std::vector &ranges, CachedFileWriter *writer) override; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/StdinPDFDocBuilder.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // StdinPDFDocBuilder.cc 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010, 2017 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #include 13 | 14 | #include "StdinPDFDocBuilder.h" 15 | #include "CachedFile.h" 16 | #include "StdinCachedFile.h" 17 | 18 | //------------------------------------------------------------------------ 19 | // StdinPDFDocBuilder 20 | //------------------------------------------------------------------------ 21 | 22 | PDFDoc *StdinPDFDocBuilder::buildPDFDoc(const GooString &uri, GooString *ownerPassword, GooString *userPassword, void *guiDataA) 23 | { 24 | CachedFile *cachedFile = new CachedFile(new StdinCacheLoader(), nullptr); 25 | return new PDFDoc(new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull)), ownerPassword, userPassword); 26 | } 27 | 28 | bool StdinPDFDocBuilder::supports(const GooString &uri) 29 | { 30 | if (uri.cmpN("fd://0", 6) == 0) { 31 | return true; 32 | } else { 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/StdinPDFDocBuilder.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // StdinPDFDocBuilder.h 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright 2010 Hib Eris 8 | // Copyright 2010, 2018 Albert Astals Cid 9 | // 10 | //======================================================================== 11 | 12 | #ifndef STDINPDFDOCBUILDER_H 13 | #define STDINPDFDOCBUILDER_H 14 | 15 | #include "PDFDocBuilder.h" 16 | 17 | //------------------------------------------------------------------------ 18 | // StdinPDFDocBuilder 19 | // 20 | // The StdinPDFDocBuilder implements a PDFDocBuilder that read from stdin. 21 | //------------------------------------------------------------------------ 22 | 23 | class StdinPDFDocBuilder : public PDFDocBuilder 24 | { 25 | 26 | public: 27 | PDFDoc *buildPDFDoc(const GooString &uri, GooString *ownerPassword = nullptr, GooString *userPassword = nullptr, void *guiDataA = nullptr) override; 28 | bool supports(const GooString &uri) override; 29 | }; 30 | 31 | #endif /* STDINPDFDOCBUILDER_H */ 32 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/UnicodeMapFuncs.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // UnicodeMapFuncs.h 4 | // 5 | // Copyright 2001-2003 Glyph & Cog, LLC 6 | // 7 | //======================================================================== 8 | 9 | //======================================================================== 10 | // 11 | // Modified under the Poppler project - http://poppler.freedesktop.org 12 | // 13 | // All changes made under the Poppler project to this file are licensed 14 | // under GPL version 2 or later 15 | // 16 | // Copyright (C) 2008 Koji Otani 17 | // Copyright (C) 2017 Adrian Johnson 18 | // Copyright (C) 2018, 2019 Albert Astals Cid 19 | // Copyright (C) 2019 Oliver Sander 20 | // 21 | // To see a description of the changes please see the Changelog file that 22 | // came with your tarball or type make ChangeLog if you are building from git 23 | // 24 | //======================================================================== 25 | 26 | #ifndef UNICODEMAPFUNCS_H 27 | #define UNICODEMAPFUNCS_H 28 | 29 | #include "UTF.h" 30 | 31 | int mapUTF8(Unicode u, char *buf, int bufSize); 32 | 33 | int mapUTF16(Unicode u, char *buf, int bufSize); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /poppler-20.12.1/poppler/gen-unicode-tables.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, print_function 2 | 3 | import sys 4 | import unicodedata 5 | 6 | 7 | if sys.version_info[0] == 2: 8 | chr = unichr 9 | 10 | UNICODE_LAST_CHAR_PART1 = 0x2FAFF 11 | HANGUL_S_BASE = 0xAC00 12 | HANGUL_S_COUNT = 19 * 21 * 28 13 | 14 | 15 | print("""// Generated by gen-unicode-tables.py 16 | 17 | typedef struct { 18 | Unicode character; 19 | int length; 20 | int offset; 21 | } decomposition; 22 | """) 23 | 24 | decomp_table = [] 25 | max_index = 0 26 | decomp_expansion_index = {} 27 | decomp_expansion = [] 28 | for u in range(0, UNICODE_LAST_CHAR_PART1): 29 | if HANGUL_S_BASE <= u < HANGUL_S_BASE + HANGUL_S_COUNT: 30 | continue 31 | norm = tuple(map(ord, unicodedata.normalize("NFKD", chr(u)))) 32 | if norm != (u, ): 33 | try: 34 | i = decomp_expansion_index[norm] 35 | decomp_table.append((u, len(norm), i)) 36 | except KeyError: 37 | decomp_table.append((u, len(norm), max_index)) 38 | decomp_expansion_index[norm] = max_index 39 | decomp_expansion.append((norm, max_index)) 40 | max_index += len(norm) 41 | print("#define DECOMP_TABLE_LENGTH %d" % (len(decomp_table), )) 42 | print() 43 | print("static const decomposition decomp_table[] = {") 44 | print(*(" { 0x%x, %d, %d }" % (character, length, offset) 45 | for character, length, offset in decomp_table), 46 | sep=",\n") 47 | print("};") 48 | print() 49 | print("static const Unicode decomp_expansion[] = {") 50 | print(*(" %s /* offset %d */" % (", ".join("0x%x" % u for u in norm), index) 51 | for norm, index in decomp_expansion), 52 | sep=" ,\n") 53 | print("};") 54 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | 3 | set(ENABLE_QT_STRICT_ITERATORS ON CACHE BOOL "Select whether to compile with QT_STRICT_ITERATORS. Leave it ON, unless your Qt lacks support, or your compiler can't do SRA optimization.") 4 | if(ENABLE_QT_STRICT_ITERATORS) 5 | add_definitions(-DQT_STRICT_ITERATORS) 6 | endif() 7 | 8 | add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050500) 9 | add_definitions(-DQT_NO_DEPRECATED_WARNINGS) 10 | 11 | add_subdirectory(src) 12 | add_subdirectory(tests) 13 | add_subdirectory(demos) 14 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | ${CMAKE_CURRENT_SOURCE_DIR} 3 | ${CMAKE_CURRENT_SOURCE_DIR}/../src 4 | ${CMAKE_CURRENT_BINARY_DIR} 5 | ) 6 | 7 | set(poppler_qt5viewer_SRCS 8 | abstractinfodock.cpp 9 | documentobserver.cpp 10 | embeddedfiles.cpp 11 | fonts.cpp 12 | info.cpp 13 | main_viewer.cpp 14 | metadata.cpp 15 | navigationtoolbar.cpp 16 | optcontent.cpp 17 | pageview.cpp 18 | permissions.cpp 19 | thumbnails.cpp 20 | toc.cpp 21 | viewer.cpp 22 | ) 23 | 24 | poppler_add_test(poppler_qt5viewer BUILD_QT5_TESTS ${poppler_qt5viewer_SRCS}) 25 | target_link_libraries(poppler_qt5viewer poppler-qt5 Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml) 26 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/abstractinfodock.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "fonts.h" 20 | 21 | AbstractInfoDock::AbstractInfoDock(QWidget *parent) : QDockWidget(parent), m_filled(false) 22 | { 23 | connect(this, &AbstractInfoDock::visibilityChanged, this, &AbstractInfoDock::slotVisibilityChanged); 24 | } 25 | 26 | AbstractInfoDock::~AbstractInfoDock() { } 27 | 28 | void AbstractInfoDock::documentLoaded() 29 | { 30 | if (!isHidden()) { 31 | fillInfo(); 32 | m_filled = true; 33 | } 34 | } 35 | 36 | void AbstractInfoDock::documentClosed() 37 | { 38 | m_filled = false; 39 | } 40 | 41 | void AbstractInfoDock::pageChanged(int page) 42 | { 43 | Q_UNUSED(page) 44 | } 45 | 46 | void AbstractInfoDock::slotVisibilityChanged(bool visible) 47 | { 48 | if (visible && document() && !m_filled) { 49 | fillInfo(); 50 | m_filled = true; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/abstractinfodock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef ABSTRACTINFODOCK_H 20 | #define ABSTRACTINFODOCK_H 21 | 22 | #include 23 | 24 | #include "documentobserver.h" 25 | 26 | class AbstractInfoDock : public QDockWidget, public DocumentObserver 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | AbstractInfoDock(QWidget *parent = nullptr); 32 | ~AbstractInfoDock() override; 33 | 34 | void documentLoaded() override; 35 | void documentClosed() override; 36 | void pageChanged(int page) override; 37 | 38 | protected: 39 | virtual void fillInfo() = 0; 40 | 41 | private Q_SLOTS: 42 | void slotVisibilityChanged(bool visible); 43 | 44 | private: 45 | bool m_filled; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/documentobserver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "documentobserver.h" 20 | 21 | #include "viewer.h" 22 | 23 | DocumentObserver::DocumentObserver() : m_viewer(nullptr) { } 24 | 25 | DocumentObserver::~DocumentObserver() { } 26 | 27 | Poppler::Document *DocumentObserver::document() const 28 | { 29 | return m_viewer->m_doc; 30 | } 31 | 32 | void DocumentObserver::setPage(int page) 33 | { 34 | m_viewer->setPage(page); 35 | } 36 | 37 | int DocumentObserver::page() const 38 | { 39 | return m_viewer->page(); 40 | } 41 | 42 | void DocumentObserver::reloadPage() 43 | { 44 | m_viewer->setPage(m_viewer->page()); 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/documentobserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * Copyright (C) 2018, Albert Astals Cid 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef DOCUMENTOBSERVER_H 21 | #define DOCUMENTOBSERVER_H 22 | 23 | class PdfViewer; 24 | namespace Poppler { 25 | class Document; 26 | } 27 | 28 | class DocumentObserver 29 | { 30 | friend class PdfViewer; 31 | 32 | public: 33 | virtual ~DocumentObserver(); 34 | DocumentObserver(const DocumentObserver &) = delete; 35 | DocumentObserver &operator=(const DocumentObserver &) = delete; 36 | 37 | virtual void documentLoaded() = 0; 38 | virtual void documentClosed() = 0; 39 | virtual void pageChanged(int page) = 0; 40 | 41 | protected: 42 | DocumentObserver(); 43 | 44 | Poppler::Document *document() const; 45 | void setPage(int page); 46 | int page() const; 47 | void reloadPage(); 48 | 49 | private: 50 | PdfViewer *m_viewer; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/embeddedfiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef ATTACHMENTS_H 20 | #define ATTACHMENTS_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTableWidget; 25 | 26 | class EmbeddedFilesDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | EmbeddedFilesDock(QWidget *parent = nullptr); 32 | ~EmbeddedFilesDock() override; 33 | 34 | void documentLoaded() override; 35 | void documentClosed() override; 36 | 37 | protected: 38 | void fillInfo() override; 39 | 40 | private: 41 | QTableWidget *m_table; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/fonts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef FONTS_H 20 | #define FONTS_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTableWidget; 25 | 26 | class FontsDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | FontsDock(QWidget *parent = nullptr); 32 | ~FontsDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QTableWidget *m_table; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef INFO_H 20 | #define INFO_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTableWidget; 25 | 26 | class InfoDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | InfoDock(QWidget *parent = nullptr); 32 | ~InfoDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QTableWidget *m_table; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/main_viewer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "viewer.h" 20 | 21 | #include 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | QApplication app(argc, argv); 26 | const QStringList args = QCoreApplication::arguments(); 27 | PdfViewer *viewer = new PdfViewer(); 28 | viewer->show(); 29 | if (args.count() > 1) { 30 | viewer->loadDocument(args.at(1)); 31 | } 32 | return app.exec(); 33 | } 34 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/metadata.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "metadata.h" 20 | 21 | #include 22 | 23 | #include 24 | 25 | MetadataDock::MetadataDock(QWidget *parent) : AbstractInfoDock(parent) 26 | { 27 | m_edit = new QTextEdit(this); 28 | setWidget(m_edit); 29 | setWindowTitle(tr("Metadata")); 30 | m_edit->setAcceptRichText(false); 31 | m_edit->setReadOnly(true); 32 | } 33 | 34 | MetadataDock::~MetadataDock() { } 35 | 36 | void MetadataDock::fillInfo() 37 | { 38 | m_edit->setPlainText(document()->metadata()); 39 | } 40 | 41 | void MetadataDock::documentClosed() 42 | { 43 | m_edit->clear(); 44 | AbstractInfoDock::documentClosed(); 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef METADATA_H 20 | #define METADATA_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTextEdit; 25 | 26 | class MetadataDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | MetadataDock(QWidget *parent = nullptr); 32 | ~MetadataDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QTextEdit *m_edit; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/optcontent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef OPTCONTENT_H 20 | #define OPTCONTENT_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTreeView; 25 | 26 | class OptContentDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | OptContentDock(QWidget *parent = nullptr); 32 | ~OptContentDock() override; 33 | 34 | void documentLoaded() override; 35 | void documentClosed() override; 36 | 37 | protected: 38 | void fillInfo() override; 39 | 40 | private Q_SLOTS: 41 | void reloadImage(); 42 | 43 | private: 44 | QTreeView *m_view; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/pageview.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008-2009, Pino Toscano 3 | * Copyright (C) 2013, Fabio D'Urso 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef PAGEVIEW_H 21 | #define PAGEVIEW_H 22 | 23 | #include 24 | 25 | #include "documentobserver.h" 26 | 27 | class QLabel; 28 | 29 | class PageView : public QScrollArea, public DocumentObserver 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | PageView(QWidget *parent = nullptr); 35 | ~PageView() override; 36 | 37 | void documentLoaded() override; 38 | void documentClosed() override; 39 | void pageChanged(int page) override; 40 | 41 | public Q_SLOTS: 42 | void slotZoomChanged(qreal value); 43 | void slotRotationChanged(int value); 44 | 45 | private: 46 | QLabel *m_imageLabel; 47 | qreal m_zoom; 48 | int m_rotation; 49 | int m_dpiX; 50 | int m_dpiY; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/permissions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008-2009, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef PERMISSIONS_H 20 | #define PERMISSIONS_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QListWidget; 25 | 26 | class PermissionsDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | PermissionsDock(QWidget *parent = nullptr); 32 | ~PermissionsDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QListWidget *m_table; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/thumbnails.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009, Shawn Rutledge 3 | * Copyright (C) 2009, Pino Toscano 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef THUMBNAILS_H 21 | #define THUMBNAILS_H 22 | 23 | #include "abstractinfodock.h" 24 | 25 | class QListWidget; 26 | class QListWidgetItem; 27 | 28 | class ThumbnailsDock : public AbstractInfoDock 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | ThumbnailsDock(QWidget *parent = nullptr); 34 | ~ThumbnailsDock() override; 35 | 36 | void documentClosed() override; 37 | 38 | protected: 39 | void fillInfo() override; 40 | 41 | private Q_SLOTS: 42 | void slotItemActivated(QListWidgetItem *item); 43 | 44 | private: 45 | QListWidget *m_list; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/demos/toc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * Copyright (C) 2019, Albert Astals Cid 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef TOC_H 21 | #define TOC_H 22 | 23 | #include "abstractinfodock.h" 24 | 25 | class QTreeView; 26 | 27 | class TocDock : public AbstractInfoDock 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | TocDock(QWidget *parent = nullptr); 33 | ~TocDock() override; 34 | 35 | void documentClosed() override; 36 | 37 | protected: 38 | void fillInfo() override; 39 | void expandItemModels(const QModelIndex &parent); 40 | 41 | private: 42 | QTreeView *m_tree; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/src/poppler-converter-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-converter-private.h: Qt interface to poppler 2 | * Copyright (C) 2007, 2009, 2018, Albert Astals Cid 3 | * Copyright (C) 2008, Pino Toscano 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef POPPLER_QT5_CONVERTER_PRIVATE_H 21 | #define POPPLER_QT5_CONVERTER_PRIVATE_H 22 | 23 | #include 24 | 25 | class QIODevice; 26 | 27 | namespace Poppler { 28 | 29 | class DocumentData; 30 | 31 | class BaseConverterPrivate 32 | { 33 | public: 34 | BaseConverterPrivate(); 35 | virtual ~BaseConverterPrivate(); 36 | 37 | BaseConverterPrivate(const BaseConverterPrivate &) = delete; 38 | BaseConverterPrivate &operator=(const BaseConverterPrivate &) = delete; 39 | 40 | QIODevice *openDevice(); 41 | void closeDevice(); 42 | 43 | DocumentData *document; 44 | QString outputFileName; 45 | QIODevice *iodev; 46 | bool ownIodev : 1; 47 | BaseConverter::Error lastError; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/src/poppler-embeddedfile-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-embeddedfile-private.h: Qt interface to poppler 2 | * Copyright (C) 2005, 2008, 2009, 2012, 2018, Albert Astals Cid 3 | * Copyright (C) 2005, Brad Hards 4 | * Copyright (C) 2008, 2011, Pino Toscano 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 POPPLER_EMBEDDEDFILE_PRIVATE_H 22 | #define POPPLER_EMBEDDEDFILE_PRIVATE_H 23 | 24 | class FileSpec; 25 | 26 | namespace Poppler { 27 | 28 | class EmbeddedFileData 29 | { 30 | public: 31 | EmbeddedFileData(FileSpec *fs); 32 | ~EmbeddedFileData(); 33 | 34 | EmbeddedFileData(const EmbeddedFileData &) = delete; 35 | EmbeddedFileData &operator=(const EmbeddedFileData &) = delete; 36 | 37 | EmbFile *embFile() const; 38 | 39 | FileSpec *filespec; 40 | }; 41 | 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/src/poppler-export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is used to set the poppler_qt5_EXPORT macros right. 3 | * This is needed for setting the visibility on windows, it will have no effect on other platforms. 4 | */ 5 | #if defined(_WIN32) 6 | # define _POPPLER_QT5_LIB_EXPORT __declspec(dllexport) 7 | # define _POPPLER_QT5_LIB_IMPORT __declspec(dllimport) 8 | #elif defined(__GNUC__) 9 | # define _POPPLER_QT5_LIB_EXPORT __attribute__((visibility("default"))) 10 | # define _POPPLER_QT5_LIB_IMPORT 11 | #else 12 | # define _POPPLER_QT5_LIB_EXPORT 13 | # define _POPPLER_QT5_LIB_IMPORT 14 | #endif 15 | 16 | #ifdef poppler_qt5_EXPORTS 17 | # define POPPLER_QT5_EXPORT _POPPLER_QT5_LIB_EXPORT 18 | #else 19 | # define POPPLER_QT5_EXPORT _POPPLER_QT5_LIB_IMPORT 20 | #endif 21 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/src/poppler-outline-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-outline-private.h: qt interface to poppler 2 | * 3 | * Copyright (C) 2018 Adam Reichold 4 | * Copyright (C) 2019 Albert Astals Cid 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 _POPPLER_OUTLINE_PRIVATE_H_ 22 | #define _POPPLER_OUTLINE_PRIVATE_H_ 23 | 24 | #include 25 | #include 26 | 27 | class OutlineItem; 28 | 29 | namespace Poppler { 30 | 31 | class DocumentData; 32 | class LinkDestination; 33 | 34 | struct OutlineItemData 35 | { 36 | OutlineItemData(::OutlineItem *oi, DocumentData *dd) : data { oi }, documentData { dd } { } 37 | ::OutlineItem *data; 38 | DocumentData *documentData; 39 | 40 | mutable QString name; 41 | mutable QSharedPointer destination; 42 | mutable QString externalFileName; 43 | mutable QString uri; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/src/poppler-page-transition-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005, 2019, Albert Astals Cid 3 | * Copyright (C) 2019 Oliver Sander 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef _POPPLER_PAGE_TRANSITION_PRIVATE_H_ 21 | #define _POPPLER_PAGE_TRANSITION_PRIVATE_H_ 22 | 23 | class Object; 24 | 25 | namespace Poppler { 26 | 27 | class PageTransitionParams 28 | { 29 | public: 30 | Object *dictObj; 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/src/poppler-qiodeviceoutstream-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-qiodevicestream-private.h: Qt5 interface to poppler 2 | * Copyright (C) 2008, Pino Toscano 3 | * Copyright (C) 2013 Adrian Johnson 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef POPPLER_QIODEVICESTREAM_PRIVATE_H 21 | #define POPPLER_QIODEVICESTREAM_PRIVATE_H 22 | 23 | #include "Object.h" 24 | #include "Stream.h" 25 | 26 | class QIODevice; 27 | 28 | namespace Poppler { 29 | 30 | class QIODeviceOutStream : public OutStream 31 | { 32 | public: 33 | QIODeviceOutStream(QIODevice *device); 34 | ~QIODeviceOutStream() override; 35 | 36 | void close() override; 37 | Goffset getPos() override; 38 | void put(char c) override; 39 | void printf(const char *format, ...) override; 40 | 41 | private: 42 | QIODevice *m_device; 43 | }; 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/src/poppler-version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2010, Pino Toscano 3 | * Copyright (C) 2018, Albert Astals Cid 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "poppler-version.h" 21 | 22 | QString Poppler::Version::string() 23 | { 24 | return QStringLiteral(POPPLER_VERSION); 25 | } 26 | 27 | unsigned int Poppler::Version::major() 28 | { 29 | return POPPLER_VERSION_MAJOR; 30 | } 31 | 32 | unsigned int Poppler::Version::minor() 33 | { 34 | return POPPLER_VERSION_MINOR; 35 | } 36 | 37 | unsigned int Poppler::Version::micro() 38 | { 39 | return POPPLER_VERSION_MICRO; 40 | } 41 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/README.unittest: -------------------------------------------------------------------------------- 1 | The unittests for the Qt5 bindings rely on the QtTestLib package, and 2 | will not be built until this is installed. If you do not have it, then 3 | you can download it from the Trolltech website. 4 | 5 | Note that there are a range of ways in which you can run the tests: 6 | 1. "make check" will run all the tests. 7 | 2. You can run a single test by executing the applicable 8 | executable. For example, you can run the PageMode tests by 9 | "./check_pagemode" 10 | 3. You can run a single function within a single test by appending the 11 | name of the function to the executable. For example, if you just want 12 | to run the FullScreen test within the PageMode tests, you can 13 | "./check_pagemode checkFullScreen". Run the executable with -functions 14 | to get a list of all the functions. 15 | 4. You can run a single function with specific data by appending the 16 | name of the function, followed by a colon, then the data label to the 17 | executable. For example, to just do the Author check within the 18 | metadata checks, you can "./check_metadata checkStrings:Author". 19 | 20 | For a full list of options, run a executable with "-help". 21 | 22 | Brad Hards 23 | bradh@frogmouth.net 24 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/check_actualtext.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | class TestActualText : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | TestActualText(QObject *parent = nullptr) : QObject(parent) { } 12 | private slots: 13 | void checkActualText1(); 14 | void checkActualText2(); 15 | 16 | private: 17 | void checkActualText(Poppler::Document *doc); 18 | }; 19 | 20 | void TestActualText::checkActualText(Poppler::Document *doc) 21 | { 22 | Poppler::Page *page = doc->page(0); 23 | QVERIFY(page); 24 | 25 | QCOMPARE(page->text(QRectF()), QLatin1String("The slow brown fox jumps over the black dog.")); 26 | 27 | delete page; 28 | } 29 | 30 | void TestActualText::checkActualText1() 31 | { 32 | Poppler::Document *doc; 33 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/WithActualText.pdf"); 34 | QVERIFY(doc); 35 | 36 | checkActualText(doc); 37 | 38 | delete doc; 39 | } 40 | 41 | void TestActualText::checkActualText2() 42 | { 43 | QFile file(TESTDATADIR "/unittestcases/WithActualText.pdf"); 44 | QVERIFY(file.open(QIODevice::ReadOnly)); 45 | 46 | Poppler::Document *doc; 47 | doc = Poppler::Document::load(&file); 48 | QVERIFY(doc); 49 | 50 | checkActualText(doc); 51 | 52 | delete doc; 53 | } 54 | 55 | QTEST_GUILESS_MAIN(TestActualText) 56 | 57 | #include "check_actualtext.moc" 58 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/check_object.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "poppler/Object.h" 5 | 6 | class TestObject : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | TestObject(QObject *parent = nullptr) : QObject(parent) { } 11 | private slots: 12 | void benchDefaultConstructor(); 13 | void benchMoveConstructor(); 14 | void benchSetToNull(); 15 | }; 16 | 17 | void TestObject::benchDefaultConstructor() 18 | { 19 | QBENCHMARK { 20 | Object obj; 21 | } 22 | } 23 | 24 | void TestObject::benchMoveConstructor() 25 | { 26 | QBENCHMARK { 27 | Object src; 28 | Object dst { std::move(src) }; 29 | } 30 | } 31 | 32 | void TestObject::benchSetToNull() 33 | { 34 | Object obj; 35 | QBENCHMARK { 36 | obj.setToNull(); 37 | } 38 | } 39 | 40 | QTEST_GUILESS_MAIN(TestObject) 41 | #include "check_object.moc" 42 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/check_outline.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | class TestOutline : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | TestOutline(QObject *parent = nullptr) : QObject(parent) { } 12 | private slots: 13 | void checkOutline_xr02(); 14 | }; 15 | 16 | void TestOutline::checkOutline_xr02() 17 | { 18 | std::unique_ptr document { Poppler::Document::load(TESTDATADIR "/unittestcases/xr02.pdf") }; 19 | QVERIFY(document.get()); 20 | 21 | const auto outline = document->outline(); 22 | QCOMPARE(outline.size(), 2); 23 | 24 | const auto &foo = outline[0]; 25 | QVERIFY(!foo.isNull()); 26 | QCOMPARE(foo.name(), QStringLiteral("foo")); 27 | QCOMPARE(foo.isOpen(), false); 28 | const auto fooDest = foo.destination(); 29 | QVERIFY(!fooDest.isNull()); 30 | QCOMPARE(fooDest->pageNumber(), 1); 31 | QVERIFY(foo.externalFileName().isEmpty()); 32 | QVERIFY(foo.uri().isEmpty()); 33 | QVERIFY(!foo.hasChildren()); 34 | QVERIFY(foo.children().isEmpty()); 35 | 36 | const auto &bar = outline[1]; 37 | QVERIFY(!bar.isNull()); 38 | QCOMPARE(bar.name(), QStringLiteral("bar")); 39 | QCOMPARE(bar.isOpen(), false); 40 | const auto barDest = bar.destination(); 41 | QVERIFY(!barDest.isNull()); 42 | QCOMPARE(barDest->pageNumber(), 2); 43 | QVERIFY(bar.externalFileName().isEmpty()); 44 | QVERIFY(bar.uri().isEmpty()); 45 | QVERIFY(!bar.hasChildren()); 46 | QVERIFY(bar.children().isEmpty()); 47 | } 48 | 49 | QTEST_GUILESS_MAIN(TestOutline) 50 | #include "check_outline.moc" 51 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/check_pagelayout.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | class TestPageLayout : public QObject 6 | { 7 | Q_OBJECT 8 | public: 9 | TestPageLayout(QObject *parent = nullptr) : QObject(parent) { } 10 | private slots: 11 | void checkNone(); 12 | void checkSingle(); 13 | void checkFacing(); 14 | }; 15 | 16 | void TestPageLayout::checkNone() 17 | { 18 | Poppler::Document *doc; 19 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/UseNone.pdf"); 20 | QVERIFY(doc); 21 | 22 | QCOMPARE(doc->pageLayout(), Poppler::Document::NoLayout); 23 | 24 | delete doc; 25 | } 26 | 27 | void TestPageLayout::checkSingle() 28 | { 29 | Poppler::Document *doc; 30 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/FullScreen.pdf"); 31 | QVERIFY(doc); 32 | 33 | QCOMPARE(doc->pageLayout(), Poppler::Document::SinglePage); 34 | 35 | delete doc; 36 | } 37 | 38 | void TestPageLayout::checkFacing() 39 | { 40 | Poppler::Document *doc; 41 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/doublepage.pdf"); 42 | QVERIFY(doc); 43 | 44 | QCOMPARE(doc->pageLayout(), Poppler::Document::TwoPageRight); 45 | 46 | delete doc; 47 | } 48 | 49 | QTEST_GUILESS_MAIN(TestPageLayout) 50 | #include "check_pagelayout.moc" 51 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/check_permissions.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | class TestPermissions : public QObject 6 | { 7 | Q_OBJECT 8 | public: 9 | TestPermissions(QObject *parent = nullptr) : QObject(parent) { } 10 | private slots: 11 | void permissions1(); 12 | }; 13 | 14 | void TestPermissions::permissions1() 15 | { 16 | Poppler::Document *doc; 17 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/orientation.pdf"); 18 | QVERIFY(doc); 19 | 20 | // we are allowed to print 21 | QVERIFY(doc->okToPrint()); 22 | 23 | // we are not allowed to change 24 | QVERIFY(!(doc->okToChange())); 25 | 26 | // we are not allowed to copy or extract content 27 | QVERIFY(!(doc->okToCopy())); 28 | 29 | // we are not allowed to print at high resolution 30 | QVERIFY(!(doc->okToPrintHighRes())); 31 | 32 | // we are not allowed to fill forms 33 | QVERIFY(!(doc->okToFillForm())); 34 | 35 | // we are allowed to extract content for accessibility 36 | QVERIFY(doc->okToExtractForAccessibility()); 37 | 38 | // we are allowed to assemble this document 39 | QVERIFY(doc->okToAssemble()); 40 | 41 | delete doc; 42 | } 43 | 44 | QTEST_GUILESS_MAIN(TestPermissions) 45 | #include "check_permissions.moc" 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/fuzzing/qt_annot_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static void dummy_error_function(const QString &, const QVariant &) { } 6 | 7 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 8 | { 9 | Poppler::setDebugErrorFunction(dummy_error_function, QVariant()); 10 | const QFont font(QStringLiteral("Helvetica"), 20); 11 | const QColor color = QColor::fromRgb(0xAB, 0xCD, 0xEF); 12 | 13 | QByteArray in_data = QByteArray::fromRawData((const char *)data, size); 14 | Poppler::Document *doc = Poppler::Document::loadFromData(in_data); 15 | 16 | if (!doc || doc->isLocked()) { 17 | delete doc; 18 | return 0; 19 | } 20 | 21 | for (int i = 0; i < doc->numPages(); i++) { 22 | Poppler::Page *p = doc->page(i); 23 | if (!p) { 24 | continue; 25 | } 26 | Poppler::TextAnnotation *ann = new Poppler::TextAnnotation(Poppler::TextAnnotation::InPlace); 27 | ann->setTextFont(font); 28 | ann->setTextColor(color); 29 | ann->setBoundary(QRectF(0.1, 0.1, 0.2, 0.2)); 30 | ann->setContents(QString(in_data)); 31 | p->addAnnotation(ann); 32 | 33 | QBuffer buffer; 34 | buffer.open(QIODevice::WriteOnly); 35 | std::unique_ptr conv(doc->pdfConverter()); 36 | conv->setOutputDevice(&buffer); 37 | conv->setPDFOptions(Poppler::PDFConverter::WithChanges); 38 | conv->convert(); 39 | buffer.close(); 40 | delete ann; 41 | delete p; 42 | } 43 | 44 | delete doc; 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/fuzzing/qt_label_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static void dummy_error_function(const QString &, const QVariant &) { } 6 | 7 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 8 | { 9 | Poppler::setDebugErrorFunction(dummy_error_function, QVariant()); 10 | QByteArray in_data = QByteArray::fromRawData((const char *)data, size); 11 | Poppler::Document *doc = Poppler::Document::loadFromData(in_data); 12 | if (!doc || doc->isLocked()) { 13 | delete doc; 14 | return 0; 15 | } 16 | 17 | for (int i = 0; i < doc->numPages(); i++) { 18 | QString label = QString(in_data); 19 | Poppler::Page *p = doc->page(label); 20 | if (!p) { 21 | continue; 22 | } 23 | QImage image = p->renderToImage(72.0, 72.0, -1, -1, -1, -1, Poppler::Page::Rotate0); 24 | delete p; 25 | } 26 | 27 | delete doc; 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/fuzzing/qt_pdf_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static void dummy_error_function(const QString &, const QVariant &) { } 6 | 7 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 8 | { 9 | Poppler::setDebugErrorFunction(dummy_error_function, QVariant()); 10 | QByteArray in_data = QByteArray::fromRawData((const char *)data, size); 11 | Poppler::Document *doc = Poppler::Document::loadFromData(in_data); 12 | if (!doc || doc->isLocked()) { 13 | delete doc; 14 | return 0; 15 | } 16 | 17 | for (int i = 0; i < doc->numPages(); i++) { 18 | Poppler::Page *p = doc->page(i); 19 | if (!p) { 20 | continue; 21 | } 22 | QImage image = p->renderToImage(72.0, 72.0, -1, -1, -1, -1, Poppler::Page::Rotate0); 23 | delete p; 24 | } 25 | delete doc; 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/fuzzing/qt_search_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static void dummy_error_function(const QString &, const QVariant &) { } 5 | 6 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 7 | { 8 | Poppler::setDebugErrorFunction(dummy_error_function, QVariant()); 9 | QByteArray in_data = QByteArray::fromRawData((const char *)data, size); 10 | Poppler::Document *doc = Poppler::Document::loadFromData(in_data); 11 | if (!doc || doc->isLocked()) { 12 | delete doc; 13 | return 0; 14 | } 15 | 16 | for (int i = 0; i < doc->numPages(); i++) { 17 | Poppler::Page *p = doc->page(i); 18 | if (!p) { 19 | continue; 20 | } 21 | QString text = QString(in_data); 22 | p->search(text, Poppler::Page::IgnoreCase, Poppler::Page::Rotate0); 23 | delete p; 24 | } 25 | 26 | delete doc; 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/fuzzing/qt_textbox_fuzzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static void dummy_error_function(const QString &, const QVariant &) { } 7 | 8 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 9 | { 10 | Poppler::setDebugErrorFunction(dummy_error_function, QVariant()); 11 | QByteArray in_data = QByteArray::fromRawData((const char *)data, size); 12 | Poppler::Document *doc = Poppler::Document::loadFromData(in_data); 13 | if (!doc || doc->isLocked()) { 14 | delete doc; 15 | return 0; 16 | } 17 | 18 | for (int i = 0; i < doc->numPages(); i++) { 19 | Poppler::Page *p = doc->page(i); 20 | if (!p) { 21 | continue; 22 | } 23 | QRectF rf = QRectF(0.0, 0.0, 1.0, 1.0); 24 | Poppler::TextBox tb(QString(in_data), rf); 25 | QImage image = p->renderToImage(72.0, 72.0, -1, -1, -1, -1, Poppler::Page::Rotate0); 26 | QPainter painter(&image); 27 | painter.drawRect(tb.boundingBox()); 28 | delete p; 29 | } 30 | delete doc; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/poppler-attachments.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | QCoreApplication a(argc, argv); // QApplication required! 11 | 12 | if (!(argc == 2)) { 13 | qWarning() << "usage: poppler-attachments filename"; 14 | exit(1); 15 | } 16 | 17 | Poppler::Document *doc = Poppler::Document::load(argv[1]); 18 | if (!doc) { 19 | qWarning() << "doc not loaded"; 20 | exit(1); 21 | } 22 | 23 | if (doc->hasEmbeddedFiles()) { 24 | std::cout << "Embedded files: " << std::endl; 25 | foreach (Poppler::EmbeddedFile *file, doc->embeddedFiles()) { 26 | std::cout << " " << qPrintable(file->name()) << std::endl; 27 | std::cout << " desc:" << qPrintable(file->description()) << std::endl; 28 | QByteArray data = file->data(); 29 | std::cout << " data: " << data.constData() << std::endl; 30 | } 31 | 32 | } else { 33 | std::cout << "There are no embedded document at the top level" << std::endl; 34 | } 35 | delete doc; 36 | } 37 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/poppler-page-labels.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | int main(int argc, char **argv) 10 | { 11 | QCoreApplication a(argc, argv); // QApplication required! 12 | 13 | if (!(argc == 2)) { 14 | qWarning() << "usage: poppler-page-labels filename"; 15 | exit(1); 16 | } 17 | 18 | Poppler::Document *doc = Poppler::Document::load(argv[1]); 19 | if (!doc || doc->isLocked()) { 20 | qWarning() << "doc not loaded"; 21 | exit(1); 22 | } 23 | 24 | for (int i = 0; i < doc->numPages(); i++) { 25 | int j = 0; 26 | std::cout << "*** Label of Page " << i << std::endl; 27 | std::cout << std::flush; 28 | 29 | std::unique_ptr page(doc->page(i)); 30 | 31 | if (!page) 32 | continue; 33 | 34 | const QByteArray utf8str = page->label().toUtf8(); 35 | for (j = 0; j < utf8str.size(); j++) 36 | std::cout << utf8str[j]; 37 | std::cout << std::endl; 38 | 39 | std::unique_ptr pageFromPageLabel(doc->page(page->label())); 40 | const int indexFromPageLabel = pageFromPageLabel ? pageFromPageLabel->index() : -1; 41 | if (indexFromPageLabel != i) 42 | std::cout << "WARNING: Page label didn't link back to the same page index " << indexFromPageLabel << " " << i << std::endl; 43 | } 44 | delete doc; 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt5/tests/poppler-texts.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | QCoreApplication a(argc, argv); // QApplication required! 11 | 12 | if (!(argc == 2)) { 13 | qWarning() << "usage: poppler-texts filename"; 14 | exit(1); 15 | } 16 | 17 | Poppler::Document *doc = Poppler::Document::load(argv[1]); 18 | if (!doc) { 19 | qWarning() << "doc not loaded"; 20 | exit(1); 21 | } 22 | 23 | for (int i = 0; i < doc->numPages(); i++) { 24 | int j = 0; 25 | std::cout << "*** Page " << i << std::endl; 26 | std::cout << std::flush; 27 | 28 | Poppler::Page *page = doc->page(i); 29 | const QByteArray utf8str = page->text(QRectF(), Poppler::Page::RawOrderLayout).toUtf8(); 30 | std::cout << std::flush; 31 | for (j = 0; j < utf8str.size(); j++) 32 | std::cout << utf8str[j]; 33 | std::cout << std::endl; 34 | delete page; 35 | } 36 | delete doc; 37 | } 38 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | 3 | set(ENABLE_QT_STRICT_ITERATORS ON CACHE BOOL "Select whether to compile with QT_STRICT_ITERATORS. Leave it ON, unless your Qt lacks support, or your compiler can't do SRA optimization.") 4 | if(ENABLE_QT_STRICT_ITERATORS) 5 | add_definitions(-DQT_STRICT_ITERATORS) 6 | endif() 7 | 8 | add_subdirectory(src) 9 | 10 | add_subdirectory(tests) 11 | add_subdirectory(demos) 12 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | ${CMAKE_CURRENT_SOURCE_DIR} 3 | ${CMAKE_CURRENT_SOURCE_DIR}/../src 4 | ${CMAKE_CURRENT_BINARY_DIR} 5 | ) 6 | 7 | set(poppler_qt6viewer_SRCS 8 | abstractinfodock.cpp 9 | documentobserver.cpp 10 | embeddedfiles.cpp 11 | fonts.cpp 12 | info.cpp 13 | main_viewer.cpp 14 | metadata.cpp 15 | navigationtoolbar.cpp 16 | optcontent.cpp 17 | pageview.cpp 18 | permissions.cpp 19 | thumbnails.cpp 20 | toc.cpp 21 | viewer.cpp 22 | ) 23 | 24 | poppler_add_test(poppler_qt6viewer BUILD_QT6_TESTS ${poppler_qt6viewer_SRCS}) 25 | target_link_libraries(poppler_qt6viewer poppler-qt6 Qt6::Widgets) 26 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/abstractinfodock.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "fonts.h" 20 | 21 | AbstractInfoDock::AbstractInfoDock(QWidget *parent) : QDockWidget(parent), m_filled(false) 22 | { 23 | connect(this, &AbstractInfoDock::visibilityChanged, this, &AbstractInfoDock::slotVisibilityChanged); 24 | } 25 | 26 | AbstractInfoDock::~AbstractInfoDock() { } 27 | 28 | void AbstractInfoDock::documentLoaded() 29 | { 30 | if (!isHidden()) { 31 | fillInfo(); 32 | m_filled = true; 33 | } 34 | } 35 | 36 | void AbstractInfoDock::documentClosed() 37 | { 38 | m_filled = false; 39 | } 40 | 41 | void AbstractInfoDock::pageChanged(int page) 42 | { 43 | Q_UNUSED(page) 44 | } 45 | 46 | void AbstractInfoDock::slotVisibilityChanged(bool visible) 47 | { 48 | if (visible && document() && !m_filled) { 49 | fillInfo(); 50 | m_filled = true; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/abstractinfodock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef ABSTRACTINFODOCK_H 20 | #define ABSTRACTINFODOCK_H 21 | 22 | #include 23 | 24 | #include "documentobserver.h" 25 | 26 | class AbstractInfoDock : public QDockWidget, public DocumentObserver 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | AbstractInfoDock(QWidget *parent = nullptr); 32 | ~AbstractInfoDock() override; 33 | 34 | void documentLoaded() override; 35 | void documentClosed() override; 36 | void pageChanged(int page) override; 37 | 38 | protected: 39 | virtual void fillInfo() = 0; 40 | 41 | private Q_SLOTS: 42 | void slotVisibilityChanged(bool visible); 43 | 44 | private: 45 | bool m_filled; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/documentobserver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "documentobserver.h" 20 | 21 | #include "viewer.h" 22 | 23 | DocumentObserver::DocumentObserver() : m_viewer(nullptr) { } 24 | 25 | DocumentObserver::~DocumentObserver() { } 26 | 27 | Poppler::Document *DocumentObserver::document() const 28 | { 29 | return m_viewer->m_doc; 30 | } 31 | 32 | void DocumentObserver::setPage(int page) 33 | { 34 | m_viewer->setPage(page); 35 | } 36 | 37 | int DocumentObserver::page() const 38 | { 39 | return m_viewer->page(); 40 | } 41 | 42 | void DocumentObserver::reloadPage() 43 | { 44 | m_viewer->setPage(m_viewer->page()); 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/documentobserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * Copyright (C) 2018, Albert Astals Cid 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef DOCUMENTOBSERVER_H 21 | #define DOCUMENTOBSERVER_H 22 | 23 | class PdfViewer; 24 | namespace Poppler { 25 | class Document; 26 | } 27 | 28 | class DocumentObserver 29 | { 30 | friend class PdfViewer; 31 | 32 | public: 33 | virtual ~DocumentObserver(); 34 | DocumentObserver(const DocumentObserver &) = delete; 35 | DocumentObserver &operator=(const DocumentObserver &) = delete; 36 | 37 | virtual void documentLoaded() = 0; 38 | virtual void documentClosed() = 0; 39 | virtual void pageChanged(int page) = 0; 40 | 41 | protected: 42 | DocumentObserver(); 43 | 44 | Poppler::Document *document() const; 45 | void setPage(int page); 46 | int page() const; 47 | void reloadPage(); 48 | 49 | private: 50 | PdfViewer *m_viewer; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/embeddedfiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef ATTACHMENTS_H 20 | #define ATTACHMENTS_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTableWidget; 25 | 26 | class EmbeddedFilesDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | EmbeddedFilesDock(QWidget *parent = nullptr); 32 | ~EmbeddedFilesDock() override; 33 | 34 | void documentLoaded() override; 35 | void documentClosed() override; 36 | 37 | protected: 38 | void fillInfo() override; 39 | 40 | private: 41 | QTableWidget *m_table; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/fonts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef FONTS_H 20 | #define FONTS_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTableWidget; 25 | 26 | class FontsDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | FontsDock(QWidget *parent = nullptr); 32 | ~FontsDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QTableWidget *m_table; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef INFO_H 20 | #define INFO_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTableWidget; 25 | 26 | class InfoDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | InfoDock(QWidget *parent = nullptr); 32 | ~InfoDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QTableWidget *m_table; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/main_viewer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "viewer.h" 20 | 21 | #include 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | QApplication app(argc, argv); 26 | const QStringList args = QCoreApplication::arguments(); 27 | PdfViewer *viewer = new PdfViewer(); 28 | viewer->show(); 29 | if (args.count() > 1) { 30 | viewer->loadDocument(args.at(1)); 31 | } 32 | return app.exec(); 33 | } 34 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/metadata.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #include "metadata.h" 20 | 21 | #include 22 | 23 | #include 24 | 25 | MetadataDock::MetadataDock(QWidget *parent) : AbstractInfoDock(parent) 26 | { 27 | m_edit = new QTextEdit(this); 28 | setWidget(m_edit); 29 | setWindowTitle(tr("Metadata")); 30 | m_edit->setAcceptRichText(false); 31 | m_edit->setReadOnly(true); 32 | } 33 | 34 | MetadataDock::~MetadataDock() { } 35 | 36 | void MetadataDock::fillInfo() 37 | { 38 | m_edit->setPlainText(document()->metadata()); 39 | } 40 | 41 | void MetadataDock::documentClosed() 42 | { 43 | m_edit->clear(); 44 | AbstractInfoDock::documentClosed(); 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef METADATA_H 20 | #define METADATA_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTextEdit; 25 | 26 | class MetadataDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | MetadataDock(QWidget *parent = nullptr); 32 | ~MetadataDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QTextEdit *m_edit; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/optcontent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef OPTCONTENT_H 20 | #define OPTCONTENT_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QTreeView; 25 | 26 | class OptContentDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | OptContentDock(QWidget *parent = nullptr); 32 | ~OptContentDock() override; 33 | 34 | void documentLoaded() override; 35 | void documentClosed() override; 36 | 37 | protected: 38 | void fillInfo() override; 39 | 40 | private Q_SLOTS: 41 | void reloadImage(); 42 | 43 | private: 44 | QTreeView *m_view; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/pageview.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008-2009, Pino Toscano 3 | * Copyright (C) 2013, Fabio D'Urso 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef PAGEVIEW_H 21 | #define PAGEVIEW_H 22 | 23 | #include 24 | 25 | #include "documentobserver.h" 26 | 27 | class QLabel; 28 | 29 | class PageView : public QScrollArea, public DocumentObserver 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | PageView(QWidget *parent = nullptr); 35 | ~PageView() override; 36 | 37 | void documentLoaded() override; 38 | void documentClosed() override; 39 | void pageChanged(int page) override; 40 | 41 | public Q_SLOTS: 42 | void slotZoomChanged(qreal value); 43 | void slotRotationChanged(int value); 44 | 45 | private: 46 | QLabel *m_imageLabel; 47 | qreal m_zoom; 48 | int m_rotation; 49 | int m_dpiX; 50 | int m_dpiY; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/permissions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008-2009, Pino Toscano 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef PERMISSIONS_H 20 | #define PERMISSIONS_H 21 | 22 | #include "abstractinfodock.h" 23 | 24 | class QListWidget; 25 | 26 | class PermissionsDock : public AbstractInfoDock 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | PermissionsDock(QWidget *parent = nullptr); 32 | ~PermissionsDock() override; 33 | 34 | void documentClosed() override; 35 | 36 | protected: 37 | void fillInfo() override; 38 | 39 | private: 40 | QListWidget *m_table; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/thumbnails.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009, Shawn Rutledge 3 | * Copyright (C) 2009, Pino Toscano 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef THUMBNAILS_H 21 | #define THUMBNAILS_H 22 | 23 | #include "abstractinfodock.h" 24 | 25 | class QListWidget; 26 | class QListWidgetItem; 27 | 28 | class ThumbnailsDock : public AbstractInfoDock 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | ThumbnailsDock(QWidget *parent = nullptr); 34 | ~ThumbnailsDock() override; 35 | 36 | void documentClosed() override; 37 | 38 | protected: 39 | void fillInfo() override; 40 | 41 | private Q_SLOTS: 42 | void slotItemActivated(QListWidgetItem *item); 43 | 44 | private: 45 | QListWidget *m_list; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/demos/toc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Pino Toscano 3 | * Copyright (C) 2019, Albert Astals Cid 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef TOC_H 21 | #define TOC_H 22 | 23 | #include "abstractinfodock.h" 24 | 25 | class QTreeView; 26 | 27 | class TocDock : public AbstractInfoDock 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | TocDock(QWidget *parent = nullptr); 33 | ~TocDock() override; 34 | 35 | void documentClosed() override; 36 | 37 | protected: 38 | void fillInfo() override; 39 | void expandItemModels(const QModelIndex &parent); 40 | 41 | private: 42 | QTreeView *m_tree; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/src/poppler-converter-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-converter-private.h: Qt interface to poppler 2 | * Copyright (C) 2007, 2009, 2018, Albert Astals Cid 3 | * Copyright (C) 2008, Pino Toscano 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef POPPLER_QT6_CONVERTER_PRIVATE_H 21 | #define POPPLER_QT6_CONVERTER_PRIVATE_H 22 | 23 | #include 24 | 25 | class QIODevice; 26 | 27 | namespace Poppler { 28 | 29 | class DocumentData; 30 | 31 | class BaseConverterPrivate 32 | { 33 | public: 34 | BaseConverterPrivate(); 35 | virtual ~BaseConverterPrivate(); 36 | 37 | BaseConverterPrivate(const BaseConverterPrivate &) = delete; 38 | BaseConverterPrivate &operator=(const BaseConverterPrivate &) = delete; 39 | 40 | QIODevice *openDevice(); 41 | void closeDevice(); 42 | 43 | DocumentData *document; 44 | QString outputFileName; 45 | QIODevice *iodev; 46 | bool ownIodev : 1; 47 | BaseConverter::Error lastError; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/src/poppler-embeddedfile-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-embeddedfile-private.h: Qt interface to poppler 2 | * Copyright (C) 2005, 2008, 2009, 2012, 2018, Albert Astals Cid 3 | * Copyright (C) 2005, Brad Hards 4 | * Copyright (C) 2008, 2011, Pino Toscano 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 POPPLER_EMBEDDEDFILE_PRIVATE_H 22 | #define POPPLER_EMBEDDEDFILE_PRIVATE_H 23 | 24 | class FileSpec; 25 | 26 | namespace Poppler { 27 | 28 | class EmbeddedFileData 29 | { 30 | public: 31 | EmbeddedFileData(FileSpec *fs); 32 | ~EmbeddedFileData(); 33 | 34 | EmbeddedFileData(const EmbeddedFileData &) = delete; 35 | EmbeddedFileData &operator=(const EmbeddedFileData &) = delete; 36 | 37 | EmbFile *embFile() const; 38 | 39 | FileSpec *filespec; 40 | }; 41 | 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/src/poppler-export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is used to set the poppler_qt6_EXPORT macros right. 3 | * This is needed for setting the visibility on windows, it will have no effect on other platforms. 4 | */ 5 | #if defined(_WIN32) 6 | # define _POPPLER_QT6_LIB_EXPORT __declspec(dllexport) 7 | # define _POPPLER_QT6_LIB_IMPORT __declspec(dllimport) 8 | #elif defined(__GNUC__) 9 | # define _POPPLER_QT6_LIB_EXPORT __attribute__((visibility("default"))) 10 | # define _POPPLER_QT6_LIB_IMPORT 11 | #else 12 | # define _POPPLER_QT6_LIB_EXPORT 13 | # define _POPPLER_QT6_LIB_IMPORT 14 | #endif 15 | 16 | #ifdef poppler_qt6_EXPORTS 17 | # define POPPLER_QT6_EXPORT _POPPLER_QT6_LIB_EXPORT 18 | #else 19 | # define POPPLER_QT6_EXPORT _POPPLER_QT6_LIB_IMPORT 20 | #endif 21 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/src/poppler-outline-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-outline-private.h: qt interface to poppler 2 | * 3 | * Copyright (C) 2018 Adam Reichold 4 | * Copyright (C) 2019 Albert Astals Cid 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 _POPPLER_OUTLINE_PRIVATE_H_ 22 | #define _POPPLER_OUTLINE_PRIVATE_H_ 23 | 24 | #include 25 | #include 26 | 27 | class OutlineItem; 28 | 29 | namespace Poppler { 30 | 31 | class DocumentData; 32 | class LinkDestination; 33 | 34 | struct OutlineItemData 35 | { 36 | OutlineItemData(::OutlineItem *oi, DocumentData *dd) : data { oi }, documentData { dd } { } 37 | ::OutlineItem *data; 38 | DocumentData *documentData; 39 | 40 | mutable QString name; 41 | mutable QSharedPointer destination; 42 | mutable QString externalFileName; 43 | mutable QString uri; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/src/poppler-page-transition-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005, 2019, Albert Astals Cid 3 | * Copyright (C) 2019 Oliver Sander 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef _POPPLER_PAGE_TRANSITION_PRIVATE_H_ 21 | #define _POPPLER_PAGE_TRANSITION_PRIVATE_H_ 22 | 23 | class Object; 24 | 25 | namespace Poppler { 26 | 27 | class PageTransitionParams 28 | { 29 | public: 30 | Object *dictObj; 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/src/poppler-qiodeviceoutstream-private.h: -------------------------------------------------------------------------------- 1 | /* poppler-qiodevicestream-private.h: Qt6 interface to poppler 2 | * Copyright (C) 2008, Pino Toscano 3 | * Copyright (C) 2013 Adrian Johnson 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef POPPLER_QIODEVICESTREAM_PRIVATE_H 21 | #define POPPLER_QIODEVICESTREAM_PRIVATE_H 22 | 23 | #include "Object.h" 24 | #include "Stream.h" 25 | 26 | class QIODevice; 27 | 28 | namespace Poppler { 29 | 30 | class QIODeviceOutStream : public OutStream 31 | { 32 | public: 33 | QIODeviceOutStream(QIODevice *device); 34 | ~QIODeviceOutStream() override; 35 | 36 | void close() override; 37 | Goffset getPos() override; 38 | void put(char c) override; 39 | void printf(const char *format, ...) override; 40 | 41 | private: 42 | QIODevice *m_device; 43 | }; 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/src/poppler-version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2010, Pino Toscano 3 | * Copyright (C) 2018, Albert Astals Cid 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "poppler-version.h" 21 | 22 | QString Poppler::Version::string() 23 | { 24 | return QStringLiteral(POPPLER_VERSION); 25 | } 26 | 27 | unsigned int Poppler::Version::major() 28 | { 29 | return POPPLER_VERSION_MAJOR; 30 | } 31 | 32 | unsigned int Poppler::Version::minor() 33 | { 34 | return POPPLER_VERSION_MINOR; 35 | } 36 | 37 | unsigned int Poppler::Version::micro() 38 | { 39 | return POPPLER_VERSION_MICRO; 40 | } 41 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/README.unittest: -------------------------------------------------------------------------------- 1 | The unittests for the Qt6 bindings rely on the QtTestLib package, and 2 | will not be built until this is installed. If you do not have it, then 3 | you can download it from the Trolltech website. 4 | 5 | Note that there are a range of ways in which you can run the tests: 6 | 1. "make check" will run all the tests. 7 | 2. You can run a single test by executing the applicable 8 | executable. For example, you can run the PageMode tests by 9 | "./check_pagemode" 10 | 3. You can run a single function within a single test by appending the 11 | name of the function to the executable. For example, if you just want 12 | to run the FullScreen test within the PageMode tests, you can 13 | "./check_pagemode checkFullScreen". Run the executable with -functions 14 | to get a list of all the functions. 15 | 4. You can run a single function with specific data by appending the 16 | name of the function, followed by a colon, then the data label to the 17 | executable. For example, to just do the Author check within the 18 | metadata checks, you can "./check_metadata checkStrings:Author". 19 | 20 | For a full list of options, run a executable with "-help". 21 | 22 | Brad Hards 23 | bradh@frogmouth.net 24 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/check_actualtext.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | class TestActualText : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | TestActualText(QObject *parent = nullptr) : QObject(parent) { } 12 | private slots: 13 | void checkActualText1(); 14 | void checkActualText2(); 15 | 16 | private: 17 | void checkActualText(Poppler::Document *doc); 18 | }; 19 | 20 | void TestActualText::checkActualText(Poppler::Document *doc) 21 | { 22 | Poppler::Page *page = doc->page(0); 23 | QVERIFY(page); 24 | 25 | QCOMPARE(page->text(QRectF()), QLatin1String("The slow brown fox jumps over the black dog.")); 26 | 27 | delete page; 28 | } 29 | 30 | void TestActualText::checkActualText1() 31 | { 32 | Poppler::Document *doc; 33 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/WithActualText.pdf"); 34 | QVERIFY(doc); 35 | 36 | checkActualText(doc); 37 | 38 | delete doc; 39 | } 40 | 41 | void TestActualText::checkActualText2() 42 | { 43 | QFile file(TESTDATADIR "/unittestcases/WithActualText.pdf"); 44 | QVERIFY(file.open(QIODevice::ReadOnly)); 45 | 46 | Poppler::Document *doc; 47 | doc = Poppler::Document::load(&file); 48 | QVERIFY(doc); 49 | 50 | checkActualText(doc); 51 | 52 | delete doc; 53 | } 54 | 55 | QTEST_GUILESS_MAIN(TestActualText) 56 | 57 | #include "check_actualtext.moc" 58 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/check_object.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "poppler/Object.h" 5 | 6 | class TestObject : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | TestObject(QObject *parent = nullptr) : QObject(parent) { } 11 | private slots: 12 | void benchDefaultConstructor(); 13 | void benchMoveConstructor(); 14 | void benchSetToNull(); 15 | }; 16 | 17 | void TestObject::benchDefaultConstructor() 18 | { 19 | QBENCHMARK { 20 | Object obj; 21 | } 22 | } 23 | 24 | void TestObject::benchMoveConstructor() 25 | { 26 | QBENCHMARK { 27 | Object src; 28 | Object dst { std::move(src) }; 29 | } 30 | } 31 | 32 | void TestObject::benchSetToNull() 33 | { 34 | Object obj; 35 | QBENCHMARK { 36 | obj.setToNull(); 37 | } 38 | } 39 | 40 | QTEST_GUILESS_MAIN(TestObject) 41 | #include "check_object.moc" 42 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/check_outline.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | class TestOutline : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | TestOutline(QObject *parent = nullptr) : QObject(parent) { } 12 | private slots: 13 | void checkOutline_xr02(); 14 | }; 15 | 16 | void TestOutline::checkOutline_xr02() 17 | { 18 | std::unique_ptr document { Poppler::Document::load(TESTDATADIR "/unittestcases/xr02.pdf") }; 19 | QVERIFY(document.get()); 20 | 21 | const auto outline = document->outline(); 22 | QCOMPARE(outline.size(), 2); 23 | 24 | const auto &foo = outline[0]; 25 | QVERIFY(!foo.isNull()); 26 | QCOMPARE(foo.name(), QStringLiteral("foo")); 27 | QCOMPARE(foo.isOpen(), false); 28 | const auto fooDest = foo.destination(); 29 | QVERIFY(!fooDest.isNull()); 30 | QCOMPARE(fooDest->pageNumber(), 1); 31 | QVERIFY(foo.externalFileName().isEmpty()); 32 | QVERIFY(foo.uri().isEmpty()); 33 | QVERIFY(!foo.hasChildren()); 34 | QVERIFY(foo.children().isEmpty()); 35 | 36 | const auto &bar = outline[1]; 37 | QVERIFY(!bar.isNull()); 38 | QCOMPARE(bar.name(), QStringLiteral("bar")); 39 | QCOMPARE(bar.isOpen(), false); 40 | const auto barDest = bar.destination(); 41 | QVERIFY(!barDest.isNull()); 42 | QCOMPARE(barDest->pageNumber(), 2); 43 | QVERIFY(bar.externalFileName().isEmpty()); 44 | QVERIFY(bar.uri().isEmpty()); 45 | QVERIFY(!bar.hasChildren()); 46 | QVERIFY(bar.children().isEmpty()); 47 | } 48 | 49 | QTEST_GUILESS_MAIN(TestOutline) 50 | #include "check_outline.moc" 51 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/check_pagelayout.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | class TestPageLayout : public QObject 6 | { 7 | Q_OBJECT 8 | public: 9 | TestPageLayout(QObject *parent = nullptr) : QObject(parent) { } 10 | private slots: 11 | void checkNone(); 12 | void checkSingle(); 13 | void checkFacing(); 14 | }; 15 | 16 | void TestPageLayout::checkNone() 17 | { 18 | Poppler::Document *doc; 19 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/UseNone.pdf"); 20 | QVERIFY(doc); 21 | 22 | QCOMPARE(doc->pageLayout(), Poppler::Document::NoLayout); 23 | 24 | delete doc; 25 | } 26 | 27 | void TestPageLayout::checkSingle() 28 | { 29 | Poppler::Document *doc; 30 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/FullScreen.pdf"); 31 | QVERIFY(doc); 32 | 33 | QCOMPARE(doc->pageLayout(), Poppler::Document::SinglePage); 34 | 35 | delete doc; 36 | } 37 | 38 | void TestPageLayout::checkFacing() 39 | { 40 | Poppler::Document *doc; 41 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/doublepage.pdf"); 42 | QVERIFY(doc); 43 | 44 | QCOMPARE(doc->pageLayout(), Poppler::Document::TwoPageRight); 45 | 46 | delete doc; 47 | } 48 | 49 | QTEST_GUILESS_MAIN(TestPageLayout) 50 | #include "check_pagelayout.moc" 51 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/check_permissions.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | class TestPermissions : public QObject 6 | { 7 | Q_OBJECT 8 | public: 9 | TestPermissions(QObject *parent = nullptr) : QObject(parent) { } 10 | private slots: 11 | void permissions1(); 12 | }; 13 | 14 | void TestPermissions::permissions1() 15 | { 16 | Poppler::Document *doc; 17 | doc = Poppler::Document::load(TESTDATADIR "/unittestcases/orientation.pdf"); 18 | QVERIFY(doc); 19 | 20 | // we are allowed to print 21 | QVERIFY(doc->okToPrint()); 22 | 23 | // we are not allowed to change 24 | QVERIFY(!(doc->okToChange())); 25 | 26 | // we are not allowed to copy or extract content 27 | QVERIFY(!(doc->okToCopy())); 28 | 29 | // we are not allowed to print at high resolution 30 | QVERIFY(!(doc->okToPrintHighRes())); 31 | 32 | // we are not allowed to fill forms 33 | QVERIFY(!(doc->okToFillForm())); 34 | 35 | // we are allowed to extract content for accessibility 36 | QVERIFY(doc->okToExtractForAccessibility()); 37 | 38 | // we are allowed to assemble this document 39 | QVERIFY(doc->okToAssemble()); 40 | 41 | delete doc; 42 | } 43 | 44 | QTEST_GUILESS_MAIN(TestPermissions) 45 | #include "check_permissions.moc" 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/poppler-attachments.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | QCoreApplication a(argc, argv); // QApplication required! 11 | 12 | if (!(argc == 2)) { 13 | qWarning() << "usage: poppler-attachments filename"; 14 | exit(1); 15 | } 16 | 17 | Poppler::Document *doc = Poppler::Document::load(argv[1]); 18 | if (!doc) { 19 | qWarning() << "doc not loaded"; 20 | exit(1); 21 | } 22 | 23 | if (doc->hasEmbeddedFiles()) { 24 | std::cout << "Embedded files: " << std::endl; 25 | foreach (Poppler::EmbeddedFile *file, doc->embeddedFiles()) { 26 | std::cout << " " << qPrintable(file->name()) << std::endl; 27 | std::cout << " desc:" << qPrintable(file->description()) << std::endl; 28 | QByteArray data = file->data(); 29 | std::cout << " data: " << data.constData() << std::endl; 30 | } 31 | 32 | } else { 33 | std::cout << "There are no embedded document at the top level" << std::endl; 34 | } 35 | delete doc; 36 | } 37 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/poppler-page-labels.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | int main(int argc, char **argv) 10 | { 11 | QCoreApplication a(argc, argv); // QApplication required! 12 | 13 | if (!(argc == 2)) { 14 | qWarning() << "usage: poppler-page-labels filename"; 15 | exit(1); 16 | } 17 | 18 | Poppler::Document *doc = Poppler::Document::load(argv[1]); 19 | if (!doc || doc->isLocked()) { 20 | qWarning() << "doc not loaded"; 21 | exit(1); 22 | } 23 | 24 | for (int i = 0; i < doc->numPages(); i++) { 25 | int j = 0; 26 | std::cout << "*** Label of Page " << i << std::endl; 27 | std::cout << std::flush; 28 | 29 | std::unique_ptr page(doc->page(i)); 30 | 31 | if (!page) 32 | continue; 33 | 34 | const QByteArray utf8str = page->label().toUtf8(); 35 | for (j = 0; j < utf8str.size(); j++) 36 | std::cout << utf8str[j]; 37 | std::cout << std::endl; 38 | 39 | std::unique_ptr pageFromPageLabel(doc->page(page->label())); 40 | const int indexFromPageLabel = pageFromPageLabel ? pageFromPageLabel->index() : -1; 41 | if (indexFromPageLabel != i) 42 | std::cout << "WARNING: Page label didn't link back to the same page index " << indexFromPageLabel << " " << i << std::endl; 43 | } 44 | delete doc; 45 | } 46 | -------------------------------------------------------------------------------- /poppler-20.12.1/qt6/tests/poppler-texts.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | QCoreApplication a(argc, argv); // QApplication required! 11 | 12 | if (!(argc == 2)) { 13 | qWarning() << "usage: poppler-texts filename"; 14 | exit(1); 15 | } 16 | 17 | Poppler::Document *doc = Poppler::Document::load(argv[1]); 18 | if (!doc) { 19 | qWarning() << "doc not loaded"; 20 | exit(1); 21 | } 22 | 23 | for (int i = 0; i < doc->numPages(); i++) { 24 | int j = 0; 25 | std::cout << "*** Page " << i << std::endl; 26 | std::cout << std::flush; 27 | 28 | Poppler::Page *page = doc->page(i); 29 | const QByteArray utf8str = page->text(QRectF(), Poppler::Page::RawOrderLayout).toUtf8(); 30 | std::cout << std::flush; 31 | for (j = 0; j < utf8str.size(); j++) 32 | std::cout << utf8str[j]; 33 | std::cout << std::endl; 34 | delete page; 35 | } 36 | delete doc; 37 | } 38 | -------------------------------------------------------------------------------- /poppler-20.12.1/splash/SplashErrorCodes.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // SplashErrorCodes.h 4 | // 5 | //======================================================================== 6 | 7 | //======================================================================== 8 | // 9 | // Modified under the Poppler project - http://poppler.freedesktop.org 10 | // 11 | // All changes made under the Poppler project to this file are licensed 12 | // under GPL version 2 or later 13 | // 14 | // Copyright (C) 2006, 2009 Albert Astals Cid 15 | // 16 | // To see a description of the changes please see the Changelog file that 17 | // came with your tarball or type make ChangeLog if you are building from git 18 | // 19 | //======================================================================== 20 | 21 | #ifndef SPLASHERRORCODES_H 22 | #define SPLASHERRORCODES_H 23 | 24 | //------------------------------------------------------------------------ 25 | 26 | #define splashOk 0 // no error 27 | 28 | #define splashErrNoCurPt 1 // no current point 29 | 30 | #define splashErrEmptyPath 2 // zero points in path 31 | 32 | #define splashErrBogusPath 3 // only one point in subpath 33 | 34 | #define splashErrNoSave 4 // state stack is empty 35 | 36 | #define splashErrOpenFile 5 // couldn't open file 37 | 38 | #define splashErrNoGlyph 6 // couldn't get the requested glyph 39 | 40 | #define splashErrModeMismatch 7 // invalid combination of color modes 41 | 42 | #define splashErrSingularMatrix 8 // matrix is singular 43 | 44 | #define splashErrBadArg 9 // bad argument 45 | 46 | #define splashErrZeroImage 254 // image of 0x0 47 | 48 | #define splashErrGeneric 255 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /poppler-20.12.1/splash/SplashFontFileID.cc: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // SplashFontFileID.cc 4 | // 5 | //======================================================================== 6 | 7 | #include 8 | 9 | #include "SplashFontFileID.h" 10 | 11 | //------------------------------------------------------------------------ 12 | // SplashFontFileID 13 | //------------------------------------------------------------------------ 14 | 15 | SplashFontFileID::SplashFontFileID() { } 16 | 17 | SplashFontFileID::~SplashFontFileID() { } 18 | -------------------------------------------------------------------------------- /poppler-20.12.1/splash/SplashFontFileID.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // SplashFontFileID.h 4 | // 5 | //======================================================================== 6 | 7 | //======================================================================== 8 | // 9 | // Modified under the Poppler project - http://poppler.freedesktop.org 10 | // 11 | // All changes made under the Poppler project to this file are licensed 12 | // under GPL version 2 or later 13 | // 14 | // Copyright (C) 2018 Albert Astals Cid 15 | // 16 | // To see a description of the changes please see the Changelog file that 17 | // came with your tarball or type make ChangeLog if you are building from git 18 | // 19 | //======================================================================== 20 | 21 | #ifndef SPLASHFONTFILEID_H 22 | #define SPLASHFONTFILEID_H 23 | 24 | //------------------------------------------------------------------------ 25 | // SplashFontFileID 26 | //------------------------------------------------------------------------ 27 | 28 | class SplashFontFileID 29 | { 30 | public: 31 | SplashFontFileID(); 32 | virtual ~SplashFontFileID(); 33 | SplashFontFileID(const SplashFontFileID &) = delete; 34 | SplashFontFileID &operator=(const SplashFontFileID &) = delete; 35 | virtual bool matches(SplashFontFileID *id) = 0; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /poppler-20.12.1/splash/SplashGlyphBitmap.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // SplashGlyphBitmap.h 4 | // 5 | //======================================================================== 6 | 7 | #ifndef SPLASHGLYPHBITMAP_H 8 | #define SPLASHGLYPHBITMAP_H 9 | 10 | //------------------------------------------------------------------------ 11 | // SplashGlyphBitmap 12 | //------------------------------------------------------------------------ 13 | 14 | struct SplashGlyphBitmap 15 | { 16 | int x, y, w, h; // offset and size of glyph 17 | bool aa; // anti-aliased: true means 8-bit alpha 18 | // bitmap; false means 1-bit 19 | unsigned char *data; // bitmap data 20 | bool freeData; // true if data memory should be freed 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /poppler-20.12.1/test/goostring-format-checker/README: -------------------------------------------------------------------------------- 1 | == Clang++ compiler plugin that checks usage of GooString::format-like functions == 2 | 3 | 1) Compile the plugin with: 4 | clang++ -shared -o goostring-format-checker.so goostring-format-checker.cc -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS 5 | 6 | 2) Compile poppler and pass the following options to the clang++ compiler: 7 | -Xclang -load -Xclang goostring-format-checker.so -Xclang -plugin -Xclang goostring-format-check 8 | 9 | Example: 10 | $ clang++ -shared -o goostring-format-checker.so goostring-format-checker.cc -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS 11 | $ export CXX=clang++ 12 | $ export CXXFLAGS="-Xclang -load -Xclang $PWD/goostring-format-checker.so -Xclang -add-plugin -Xclang goostring-format-checker" 13 | $ mkdir build 14 | $ cd build 15 | $ cmake ../../.. 16 | $ make 17 | -------------------------------------------------------------------------------- /poppler-20.12.1/test/perf-test-preview-dummy.cc: -------------------------------------------------------------------------------- 1 | /* Copyright Krzysztof Kowalczyk 2006-2007 2 | License: GPLv2 */ 3 | 4 | /* This is a no-op preview support for perf-test. 5 | Using this perf-test still works for performance testing, you just don't 6 | get any visual feedback during testing. 7 | */ 8 | 9 | #include "splash/SplashBitmap.h" 10 | 11 | void PreviewBitmapInit(); 12 | void PreviewBitmapDestroy(); 13 | void PreviewBitmapSplash(SplashBitmap *bmpSplash); 14 | 15 | void PreviewBitmapSplash(SplashBitmap *bmpSplash) { } 16 | 17 | void PreviewBitmapDestroy() { } 18 | 19 | void PreviewBitmapInit() { } 20 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/InMemoryFile.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // InMemoryFile.h 4 | // 5 | // Represents a file in-memory with GNU's stdio wrappers. 6 | // NOTE as of this writing, open() depends on the glibc 'fopencookie' 7 | // extension and is not supported on other platforms. The 8 | // HAVE_IN_MEMORY_FILE macro is intended to reflect whether this class is 9 | // usable. 10 | // 11 | // This file is licensed under the GPLv2 or later 12 | // 13 | // Copyright (C) 2018, 2019 Greg Knight 14 | // 15 | //======================================================================== 16 | 17 | #ifndef IN_MEMORY_FILE_H 18 | #define IN_MEMORY_FILE_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #if defined(__USE_GNU) && !defined(__ANDROID_API__) 25 | # define HAVE_IN_MEMORY_FILE (1) 26 | # define HAVE_IN_MEMORY_FILE_FOPENCOOKIE (1) // used internally 27 | #endif 28 | 29 | class InMemoryFile 30 | { 31 | private: 32 | size_t iohead; 33 | std::vector data; 34 | FILE *fptr; 35 | 36 | #ifdef HAVE_IN_MEMORY_FILE_FOPENCOOKIE 37 | ssize_t _read(char *buf, size_t sz); 38 | ssize_t _write(const char *buf, size_t sz); 39 | int _seek(off64_t *offset, int whence); 40 | #endif 41 | 42 | public: 43 | InMemoryFile(); 44 | 45 | public: 46 | /* Returns a file handle for this file. This is scoped to this object 47 | * and must be fclosed() by the caller before destruction. */ 48 | FILE *open(const char *mode); 49 | 50 | const std::vector &getBuffer() const { return data; } 51 | }; 52 | 53 | #endif // IN_MEMORY_FILE_H 54 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/numberofcharacters.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // pdfsig.cc 4 | // 5 | // This file is licensed under the GPLv2 or later 6 | // 7 | // Copyright (C) 2010 Albert Astals Cid 8 | // 9 | //======================================================================== 10 | 11 | #ifndef NUMBEROFCHARACTERS_H 12 | #define NUMBEROFCHARACTERS_H 13 | 14 | static int numberOfCharacters(unsigned int n) 15 | { 16 | int charNum = 0; 17 | while (n >= 10) { 18 | n = n / 10; 19 | charNum++; 20 | } 21 | charNum++; 22 | return charNum; 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/pdf2xml.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 16 | 17 | 23 | 24 | 31 | 32 | 33 | 34 | 37 | 38 | 45 | 46 | 47 | 50 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/pdfattach.1: -------------------------------------------------------------------------------- 1 | .\" Copyright 2019 Albert Astals Cid 2 | .TH pdfattach 1 "10 Febuary 2019" 3 | .SH NAME 4 | pdfattach \- Portable Document Format (PDF) document embedded file 5 | creator (version 3.03) 6 | .SH SYNOPSIS 7 | .B pdfattach 8 | [options] 9 | .I input-PDF-file file-to-attach output-PDF-file 10 | .SH DESCRIPTION 11 | .B Pdfattach 12 | adds a new embedded file (attachment) to an existing Portable 13 | Document Format (PDF) file. 14 | .SH OPTIONS 15 | .TP 16 | .B \-replace 17 | Replace embedded file with same name (if it exists) 18 | .TP 19 | .B \-v 20 | Print copyright and version information. 21 | .TP 22 | .B \-h 23 | Print usage information. 24 | .RB ( \-help 25 | and 26 | .B \-\-help 27 | are equivalent.) 28 | .SH EXIT CODES 29 | .TP 30 | 0 31 | No error. 32 | .TP 33 | 1 34 | Error opening input PDF file. 35 | .TP 36 | 2 37 | Error opening file to attach. 38 | .TP 39 | 3 40 | Output file already exists. 41 | .TP 42 | 3 43 | There is already an attached file with that name. 44 | .TP 45 | 5 46 | Error saving the output file. 47 | .SH AUTHOR 48 | The pdfattach software and documentation are copyright 2019 The Poppler developers 49 | .SH "SEE ALSO" 50 | .BR pdfdetach (1), 51 | .BR pdfimages (1), 52 | .BR pdfinfo (1), 53 | .BR pdftocairo (1), 54 | .BR pdftohtml (1), 55 | .BR pdftoppm (1), 56 | .BR pdftops (1), 57 | .BR pdftotext (1) 58 | .BR pdfseparate (1), 59 | .BR pdfsig (1), 60 | .BR pdfunite (1) 61 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/pdftocairo-win32.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // 3 | // This file is licensed under the GPLv2 or later 4 | // 5 | // Copyright (C) 2014 Rodrigo Rivas Costa 6 | // Copyright (C) 2014 Adrian Johnson 7 | // 8 | // To see a description of the changes please see the Changelog file that 9 | // came with your tarball or type make ChangeLog if you are building from git 10 | // 11 | //======================================================================== 12 | 13 | #include 14 | #include 15 | #include "goo/gmem.h" 16 | #include "goo/GooString.h" 17 | 18 | #ifdef CAIRO_HAS_WIN32_SURFACE 19 | 20 | # include 21 | 22 | void win32SetupPrinter(GooString *printer, GooString *printOpt, bool duplex, bool setupdlg); 23 | void win32ShowPrintDialog(bool *expand, bool *noShrink, bool *noCenter, bool *usePDFPageSize, bool *allPages, int *firstPage, int *lastPage, int maxPages); 24 | cairo_surface_t *win32BeginDocument(GooString *inputFileName, GooString *outputFileName); 25 | void win32BeginPage(double *w, double *h, bool changePageSize, bool useFullPage); 26 | void win32EndPage(GooString *imageFileName); 27 | void win32EndDocument(); 28 | 29 | #endif // CAIRO_HAS_WIN32_SURFACE 30 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/pdfunite.1: -------------------------------------------------------------------------------- 1 | .\" Copyright 2011 The Poppler Developers - http://poppler.freedesktop.org 2 | .TH pdfunite 1 "15 September 2011" 3 | .SH NAME 4 | pdfunite \- Portable Document Format (PDF) page merger 5 | .SH SYNOPSIS 6 | .B pdfunite 7 | [options] 8 | .I PDF-sourcefile1..PDF-sourcefilen PDF-destfile 9 | .SH DESCRIPTION 10 | .B pdfunite 11 | merges several PDF (Portable Document Format) files in order of their occurrence on command line to one PDF result file. 12 | .TP 13 | Neither of the PDF-sourcefile1 to PDF-sourcefilen should be encrypted. 14 | .SH OPTIONS 15 | .TP 16 | .B \-v 17 | Print copyright and version information. 18 | .TP 19 | .B \-h 20 | Print usage information. 21 | .RB ( \-help 22 | and 23 | .B \-\-help 24 | are equivalent.) 25 | .SH EXAMPLE 26 | pdfunite sample1.pdf sample2.pdf sample.pdf 27 | .TP 28 | merges all pages from sample1.pdf and sample2.pdf (in that order) and creates sample.pdf 29 | .SH AUTHOR 30 | The pdfunite software and documentation are copyright 1996-2004 Glyph & Cog, LLC 31 | and copyright 2005-2011 The Poppler Developers - http://poppler.freedesktop.org 32 | .SH "SEE ALSO" 33 | .BR pdfdetach (1), 34 | .BR pdffonts (1), 35 | .BR pdfimages (1), 36 | .BR pdfinfo (1), 37 | .BR pdftocairo (1), 38 | .BR pdftohtml (1), 39 | .BR pdftoppm (1), 40 | .BR pdftops (1), 41 | .BR pdftotext (1) 42 | .BR pdfseparate (1), 43 | .BR pdfsig (1) 44 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/printencodings.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, 2019, Albert Astals Cid 3 | * Copyright (C) 2017, Adrian Johnson 4 | * Copyright (C) 2018, Adam Reichold 5 | * Copyright (C) 2019, Oliver Sander 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2, or (at your option) 10 | * any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #include 23 | 24 | #include "printencodings.h" 25 | 26 | #include "GlobalParams.h" 27 | #include "goo/GooString.h" 28 | 29 | void printEncodings() 30 | { 31 | std::vector *encNames = globalParams->getEncodingNames(); 32 | 33 | std::sort(encNames->begin(), encNames->end(), [](void *lhs, void *rhs) { return static_cast(lhs)->cmp(static_cast(rhs)) < 0; }); 34 | 35 | printf("Available encodings are:\n"); 36 | for (const GooString *enc : *encNames) { 37 | printf("%s\n", enc->c_str()); 38 | } 39 | 40 | delete encNames; 41 | } 42 | -------------------------------------------------------------------------------- /poppler-20.12.1/utils/printencodings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008, Albert Astals Cid 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef PRINTENCODINGS_H 20 | #define PRINTENCODINGS_H 21 | 22 | void printEncodings(); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlight/pdftotext/22d0ad7ea5f96dee02ab1c2590173941f3159eaa/test.pdf --------------------------------------------------------------------------------