LibreOffice Module vcl (master) 1
pdfwriter_impl.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <sal/config.h>
23
24#include <map>
25#include <list>
26#include <unordered_map>
27#include <unordered_set>
28#include <memory>
29#include <string_view>
30#include <vector>
31#include <stack>
32
33#include <pdf/ResourceDict.hxx>
34#include <pdf/BitmapID.hxx>
35#include <pdf/Matrix3.hxx>
36
37#include <com/sun/star/lang/Locale.hpp>
38#include <com/sun/star/util/XURLTransformer.hpp>
39#include <com/sun/star/uno/Sequence.h>
40#include <osl/file.hxx>
41#include <rtl/cipher.h>
42#include <rtl/strbuf.hxx>
43#include <rtl/ustring.hxx>
44#include <tools/gen.hxx>
45#include <vcl/bitmapex.hxx>
46#include <vcl/gradient.hxx>
47#include <vcl/graphictools.hxx>
48#include <vcl/hatch.hxx>
49#include <vcl/virdev.hxx>
50#include <vcl/pdfwriter.hxx>
51#include <vcl/wall.hxx>
52#include <o3tl/safeint.hxx>
54#include <o3tl/lru_map.hxx>
55#include <comphelper/hash.hxx>
56#include <tools/stream.hxx>
58
60#include <vcl/settings.hxx>
63#include <salgdi.hxx>
64
65class FontSubsetInfo;
66class ZCodec;
68struct BitStreamState;
69namespace vcl::font { class PhysicalFontFace; }
70class SvStream;
71class SvMemoryStream;
72
73// the maximum password length
74constexpr sal_Int32 ENCRYPTED_PWD_SIZE = 32;
75constexpr sal_Int32 MD5_DIGEST_SIZE = 16;
76// security 128 bit
77constexpr sal_Int32 SECUR_128BIT_KEY = 16;
78// maximum length of MD5 digest input, in step 2 of algorithm 3.1
79// PDF spec ver. 1.4: see there for details
80constexpr sal_Int32 MAXIMUM_RC4_KEY_LENGTH = SECUR_128BIT_KEY + 3 + 2;
81
82namespace vcl::pdf
83{
84
86 Font = 0x0001,
87 MapMode = 0x0002,
88 LineColor = 0x0004,
89 FillColor = 0x0008,
90 ClipRegion = 0x0040,
91 LayoutMode = 0x0100,
92 TransparentPercent = 0x0200,
93 DigitLanguage = 0x0400,
94 All = 0x077f
95};
96
97} // end vcl::pdf
98
99namespace o3tl {
100 template<> struct typed_flags<vcl::pdf::GraphicsStateUpdateFlags> : is_typed_flags<vcl::pdf::GraphicsStateUpdateFlags, 0x077f> {};
101}
102
103namespace vcl
104{
105
106using namespace vcl::pdf;
107
108class PDFStreamIf;
109
110namespace filter
111{
112class PDFObjectElement;
113}
114
115namespace pdf
116{
117constexpr sal_Int32 g_nInheritedPageWidth = 595; // default A4 in inch/72
118constexpr sal_Int32 g_nInheritedPageHeight = 842; // default A4 in inch/72
119
121{
123 double m_nPageWidth; // in inch/72
124 double m_nPageHeight; // in inch/72
129 sal_Int32 m_nUserUnit;
131 sal_Int32 m_nPageObject;
132 std::vector<sal_Int32> m_aStreamObjects;
135 std::vector<sal_Int32> m_aAnnotations;
136 std::vector<sal_Int32> m_aMCIDParents;
138 sal_uInt32 m_nTransTime;
139
140 PDFPage( PDFWriterImpl* pWriter, double nPageWidth, double nPageHeight, PDFWriter::Orientation eOrientation );
141
142 void beginStream();
143 void endStream();
144 bool emit( sal_Int32 nParentPage );
145
146 // converts point from ref device coordinates to
147 // page coordinates and appends the point to the buffer
148 // if pOutPoint is set it will be updated to the emitted point
149 // (in PDF map mode, that is 10th of point)
150 void appendPoint( const Point& rPoint, OStringBuffer& rBuffer ) const;
151 // appends a B2DPoint without further transformation
152 void appendPixelPoint( const basegfx::B2DPoint& rPoint, OStringBuffer& rBuffer ) const;
153 // appends a rectangle
154 void appendRect( const tools::Rectangle& rRect, OStringBuffer& rBuffer ) const;
155 // converts a rectangle to 10th points page space
156 void convertRect( tools::Rectangle& rRect ) const;
157 // appends a polygon optionally closing it
158 void appendPolygon( const tools::Polygon& rPoly, OStringBuffer& rBuffer, bool bClose = true ) const;
159 // appends a polygon optionally closing it
160 void appendPolygon( const basegfx::B2DPolygon& rPoly, OStringBuffer& rBuffer ) const;
161 // appends a polypolygon optionally closing the subpaths
162 void appendPolyPolygon( const tools::PolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const;
163 // appends a polypolygon optionally closing the subpaths
164 void appendPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const;
165 // converts a length (either vertical or horizontal; this
166 // can be important if the source MapMode is not
167 // symmetrical) to page length and appends it to the buffer
168 // if pOutLength is set it will be updated to the emitted length
169 // (in PDF map mode, that is 10th of point)
170 void appendMappedLength( sal_Int32 nLength, OStringBuffer& rBuffer, bool bVertical = true, sal_Int32* pOutLength = nullptr ) const;
171 // the same for double values
172 void appendMappedLength( double fLength, OStringBuffer& rBuffer, bool bVertical = true, sal_Int32 nPrecision = 5 ) const;
173 // appends LineInfo
174 // returns false if too many dash array entry were created for
175 // the implementation limits of some PDF readers
176 bool appendLineInfo( const LineInfo& rInfo, OStringBuffer& rBuffer ) const;
177 // appends a horizontal waveline with vertical offset (helper for drawWaveLine)
178 void appendWaveLine( sal_Int32 nLength, sal_Int32 nYOffset, sal_Int32 nDelta, OStringBuffer& rBuffer ) const;
179
180 void appendMatrix3(Matrix3 const & rMatrix, OStringBuffer& rBuffer);
181
182 double getHeight() const;
183};
184
187{
189 sal_Int32 m_nFormObject;
199
201 : m_nFormObject(0)
203 , m_nBitmapObject(0)
206 {
207 }
208
210 sal_Int32 getObject() const;
211
213 {
214 return m_nExternalPDFDataIndex >= 0;
215 }
216};
217
219{
222 sal_Int32 m_nObject;
224
226 : m_nObject(0)
227 {
228 }
229};
230
232{
234 std::unique_ptr<SvMemoryStream>
237 sal_Int32 m_nObject;
240
242 : m_nObject(0)
243 , m_bTrueColor(false)
244 {
245 }
246};
247
249{
252 sal_Int32 m_nObject;
253};
254
255// for tilings (drawWallpaper, begin/endPattern)
257{
258 sal_Int32 m_nObject;
263 std::unique_ptr<SvMemoryStream> m_pTilingStream;
264
266 : m_nObject( 0 )
267 {}
268};
269
270// for transparency group XObjects
272{
273 sal_Int32 m_nObject;
275 double m_fAlpha;
277 std::unique_ptr<SvMemoryStream> m_pContentStream;
278
280 : m_nObject( 0 ),
281 m_nExtGStateObject( -1 ),
282 m_fAlpha( 0.0 )
283 {}
284};
285
286// font subsets
287
289{
290 sal_Int32 m_nFontID;
293};
294
296{
297 // performance: actually this should probably a vector;
298 std::vector<sal_Ucs> m_CodeUnits;
300 sal_Int32 m_nGlyphWidth;
301 std::vector<ColorLayer> m_aColorLayers;
305
306public:
308 {
309 }
310
311 void setGlyphId( sal_uInt8 i_nId ) { m_nSubsetGlyphID = i_nId; }
313
314 void setGlyphWidth( sal_Int32 nWidth ) { m_nGlyphWidth = nWidth; }
315 sal_Int32 getGlyphWidth() const { return m_nGlyphWidth; }
316
317 void addColorLayer(ColorLayer aLayer) { m_aColorLayers.push_back(aLayer); }
318 const std::vector<ColorLayer>& getColorLayers() const { return m_aColorLayers; }
319
321 {
323 m_aRect = aRect;
324 }
326 {
327 rRect = m_aRect;
328 return m_aColorBitmap;
329 }
330
331 void setOutline(basegfx::B2DPolyPolygon aOutline) { m_aOutline = aOutline; }
333
334 void addCode( sal_Ucs i_cCode )
335 {
336 m_CodeUnits.push_back(i_cCode);
337 }
338 sal_Int32 countCodes() const { return m_CodeUnits.size(); }
339 const std::vector<sal_Ucs>& codes() const { return m_CodeUnits; }
340 sal_Ucs getCode( sal_Int32 i_nIndex ) const
341 {
342 sal_Ucs nRet = 0;
343 if (o3tl::make_unsigned(i_nIndex) < m_CodeUnits.size())
344 nRet = m_CodeUnits[i_nIndex];
345 return nRet;
346 }
347};
348
350{
351 sal_Int32 m_nFontID;
352 std::map<sal_GlyphId, GlyphEmit> m_aMapping;
353
354 explicit FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {}
355};
356
357struct Glyph
358{
359 sal_Int32 m_nFontID;
361};
362
364{
365 std::vector< FontEmit > m_aSubsets;
366 std::map<sal_GlyphId, Glyph> m_aMapping;
367};
368
370{
373
375 : m_nNormalFontID(0)
376 , m_pFontInstance(nullptr) {}
377};
378
380{
381 sal_Int32 m_nPage;
384};
385
386//--->i56629
388{
389 OUString m_aDestName;
390 sal_Int32 m_nPage;
393};
394
396{
397 sal_Int32 m_nObject;
399 sal_Int32 m_nNextObject;
400 sal_Int32 m_nPrevObject;
401 std::vector< sal_Int32 > m_aChildren;
402 OUString m_aTitle;
403 sal_Int32 m_nDestID;
404
406 : m_nObject( 0 ),
407 m_nParentObject( 0 ),
408 m_nNextObject( 0 ),
409 m_nPrevObject( 0 ),
410 m_nDestID( -1 )
411 {}
412};
413
415{
416 sal_Int32 m_nObject;
418 sal_Int32 m_nPage;
419
421 : m_nObject( -1 ),
422 m_nPage( -1 )
423 {}
424};
425
426struct PDFLink : public PDFAnnotation
427{
428 sal_Int32 m_nDest; // set to -1 for URL, to a dest else
429 OUString m_aURL;
430 sal_Int32 m_nStructParent; // struct parent entry
431 OUString m_AltText;
432
433 PDFLink(OUString const& rAltText)
434 : m_nDest( -1 ),
435 m_nStructParent( -1 )
436 , m_AltText(rAltText)
437 {}
438};
439
442{
444 sal_Int32 m_nObject;
445 OUString m_aSubType;
448 std::unique_ptr<PDFOutputStream> m_pStream;
449
451 : m_nObject(0)
452 {
453 }
454};
455
457{
460};
461
463{
465
467
469 {}
470};
471
474{
476 OUString m_aURL;
482 OUString m_AltText;
484 OUString m_MimeType;
485
486 PDFScreen(OUString const& rAltText, OUString const& rMimeType)
488 , m_AltText(rAltText)
489 , m_nStructParent(-1)
490 , m_MimeType(rMimeType)
491 {
492 }
493};
494
496{
498 OString m_aName;
500 OUString m_aText;
502 OUString m_aValue;
503 OString m_aDAString;
504 OString m_aDRDict;
505 OString m_aMKDict;
506 OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string
507 // since the object number is not known at the moment
508 // of filling m_aMKDict, the string will be encrypted when emitted.
509 // the /CA string MUST BE the last added to m_aMKDict
510 // see code for details
511 sal_Int32 m_nFlags;
512 sal_Int32 m_nParent; // if not 0, parent's object number
513 std::vector<sal_Int32> m_aKids; // widget children, contains object numbers
514 std::vector<sal_Int32> m_aKidsIndex; // widget children, contains index to m_aWidgets
515 OUString m_aOnValue;
516 OUString m_aOffValue;
517 sal_Int32 m_nTabOrder; // lowest number gets first in tab order
518 sal_Int32 m_nRadioGroup;
519 sal_Int32 m_nMaxLen;
528 sal_Int32 m_nDest;
529 std::vector<OUString> m_aListEntries;
530 std::vector<sal_Int32> m_aSelectedEntries;
531 typedef std::unordered_map<OString, SvMemoryStream*> PDFAppearanceStreams;
532 std::unordered_map<OString, PDFAppearanceStreams> m_aAppearances;
533 sal_Int32 m_nStructParent = -1;
534
538 m_nFlags( 0 ),
539 m_nParent( 0 ),
540 m_nTabOrder( 0 ),
541 m_nRadioGroup( -1 ),
542 m_nMaxLen( 0 ),
544 m_nDecimalAccuracy ( 0 ),
546 m_bSubmit( false ),
547 m_bSubmitGet( false ),
548 m_nDest( -1 )
549 {}
550};
551
553{
555 sal_Int32 nValue;
556
559 nValue( 0 )
560 {}
561
563 : eValue( eVal ),
564 nValue( 0 )
565 {}
566
567 explicit PDFStructureAttribute( sal_Int32 nVal )
569 nValue( nVal )
570 {}
571};
572
573struct PDFStructureElementKid // for Kids entries
574{
575 sal_Int32 const nObject; // an object number if nMCID is -1,
576 // else the page object relevant to MCID
577 sal_Int32 const nMCID; // an MCID if >= 0
578
579 explicit PDFStructureElementKid( sal_Int32 nObj ) : nObject( nObj ), nMCID( -1 ) {}
580 PDFStructureElementKid( sal_Int32 MCID, sal_Int32 nPage ) : nObject( nPage ), nMCID( MCID ) {}
581};
582
584{
585 sal_Int32 m_nObject;
586 ::std::optional<PDFWriter::StructElement> m_oType;
587 OString m_aAlias;
588 sal_Int32 m_nOwnElement; // index into structure vector
589 sal_Int32 m_nParentElement; // index into structure vector
592 std::vector< sal_Int32 > m_aChildren; // indexes into structure vector
593 std::list< PDFStructureElementKid > m_aKids;
594 std::map<PDFWriter::StructAttribute, PDFStructureAttribute >
596 ::std::vector<sal_Int32> m_AnnotIds;
599 OUString m_aAltText;
600 css::lang::Locale m_aLocale;
601
602 // m_aContents contains the element's marked content sequence
603 // as pairs of (page nr, MCID)
604
606 : m_nObject( 0 ),
607 m_nOwnElement( -1 ),
608 m_nParentElement( -1 ),
610 m_bOpenMCSeq( false )
611 {
612 }
613
614};
615
616// helper structure for drawLayout and friends
618{
622 sal_Int32 const m_nNativeWidth;
623 sal_Int32 const m_nMappedFontId;
625 int const m_nCharPos;
626
628 const GlyphItem* pGlyph,
629 const LogicalFontInstance* pFont,
630 sal_Int32 nNativeWidth,
631 sal_Int32 nFontId,
632 sal_uInt8 nMappedGlyphId,
633 int nCharPos )
634 : m_aPos( rPos ), m_pGlyph(pGlyph), m_pFont(pFont), m_nNativeWidth( nNativeWidth ),
635 m_nMappedFontId( nFontId ), m_nMappedGlyphId( nMappedGlyphId ),
636 m_nCharPos(nCharPos)
637 {}
638};
639
641{
646};
647
648// graphics state
650{
663
669 m_bClipRegion( false ),
671 m_aDigitLanguage( 0 ),
674 {}
675};
676
677enum class Mode { DEFAULT, NOWRITE };
678
680{
681 OUString maFilename;
682 OUString maMimeType;
685 sal_Int32 mnObjectId;
686};
687
688} // end pdf namespace
689
691{
692 friend class PDFStreamIf;
693
694public:
695 friend struct vcl::pdf::PDFPage;
696
698 static const char* getAttributeTag( PDFWriter::StructAttribute eAtr );
699 static const char* getAttributeValueTag( PDFWriter::StructAttributeValue eVal );
700
701 // returns true if compression was done
702 // else false
703 static bool compressStream( SvMemoryStream* );
704
705 static void convertLineInfoToExtLineInfo( const LineInfo& rIn, PDFWriter::ExtLineInfo& rOut );
706
707private:
708 bool ImplNewFont() const override;
709 void ImplClearFontData(bool bNewFontLists) override;
710 void ImplRefreshFontData(bool bNewFontLists) override;
711 vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override;
712 void DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint) override;
713
714 MapMode m_aMapMode; // PDFWriterImpl scaled units
716 std::vector< PDFPage > m_aPages;
717 /* maps object numbers to file offsets (needed for xref) */
718 std::vector< sal_uInt64 > m_aObjects;
719 /* contains Bitmaps until they are written to the
720 * file stream as XObjects*/
721 std::list< BitmapEmit > m_aBitmaps;
722 /* contains JPG streams until written to file */
723 std::vector<JPGEmit> m_aJPGs;
724 /*--->i56629 contains all named destinations ever set during the PDF creation,
725 destination id is always the destination's position in this vector
726 */
727 std::vector<PDFNamedDest> m_aNamedDests;
728 /* contains all dests ever set during the PDF creation,
729 dest id is always the dest's position in this vector
730 */
731 std::vector<PDFDest> m_aDests;
734 ::std::map< sal_Int32, sal_Int32 > m_aDestinationIdTranslation;
735 /* contains all links ever set during PDF creation,
736 link id is always the link's position in this vector
737 */
738 std::vector<PDFLink> m_aLinks;
740 std::vector<PDFScreen> m_aScreens;
742 std::vector<PDFEmbeddedFile> m_aEmbeddedFiles;
743
744 std::vector<PDFDocumentAttachedFile> m_aDocumentAttachedFiles;
745
746 /* makes correctly encoded for export to PDF URLS
747 */
748 css::uno::Reference< css::util::XURLTransformer > m_xTrans;
749 /* maps arbitrary link ids for structure attributes to real link ids
750 (for setLinkPropertyId)
751 */
752 std::map<sal_Int32, sal_Int32> m_aLinkPropertyMap;
753 /* contains all outline items,
754 object 0 is the outline root
755 */
756 std::vector<PDFOutlineEntry> m_aOutline;
757 /* contains all notes set during PDF creation
758 */
759 std::vector<PDFNoteEntry> m_aNotes;
760 /* the root of the structure tree
761 */
762 std::vector<PDFStructureElement> m_aStructure;
763 /* current object in the structure hierarchy
764 */
766 std::stack<sal_Int32> m_StructElementStack;
767 /* structure parent tree */
768 std::vector< OString > m_aStructParentTree;
769 /* emit structure marks currently (aka. NonStructElement or not)
770 */
772 /* role map of struct tree root */
773 std::unordered_map< OString, OString >
775 /* structure elements (object ids) that should have ID */
776 std::unordered_set<sal_Int32> m_StructElemObjsWithID;
777
778 /* contains all widgets used in the PDF
779 */
780 std::vector<PDFWidget> m_aWidgets;
781 /* maps radio group id to index of radio group control in m_aWidgets */
782 std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets;
783 /* unordered_map for field names, used to ensure unique field names */
784 std::unordered_map< OString, sal_Int32 > m_aFieldNameMap;
785
786 /* contains Bitmaps for gradient functions until they are written
787 * to the file stream */
788 std::list< GradientEmit > m_aGradients;
789 /* contains bitmap tiling patterns */
790 std::vector< TilingEmit > m_aTilings;
791 std::vector< TransparencyEmit > m_aTransparentObjects;
792 /* contains all font subsets in use */
793 std::map<const vcl::font::PhysicalFontFace*, FontSubset> m_aSubsets;
794 std::map<const vcl::font::PhysicalFontFace*, EmbedFont> m_aSystemFonts;
795 std::map<const vcl::font::PhysicalFontFace*, FontSubset> m_aType3Fonts;
796 sal_Int32 m_nNextFID;
797
800 std::shared_ptr<SvMemoryStream>> m_aPDFBmpCache;
801
802 sal_Int32 m_nCurrentPage;
803
805 // object number of the main signature dictionary
812 std::map< sal_Int32, sal_Int32 > m_aBuildinFontToObjectMap;
813
815 osl::File m_aFile;
817
819
820 /* output redirection; e.g. to accumulate content streams for
821 XObjects
822 */
823 std::list< StreamRedirect > m_aOutputStreams;
824
825 std::list< GraphicsState > m_aGraphicsStack;
827
828 std::unique_ptr<ZCodec> m_pCodec;
829 std::unique_ptr<SvMemoryStream> m_pMemStream;
830
831 std::set< PDFWriter::ErrorCode > m_aErrors;
832
834
836 {
837 sal_uInt64 nPosition{};
838 if (osl::File::E_None != m_aFile.getPos(nPosition))
839 {
840 m_aFile.close();
841 m_bOpen = false;
842 }
843 return nPosition;
844 }
845/*
846variables for PDF security
847i12626
848*/
849/* used to cipher the stream data and for password management */
850 rtlCipher m_aCipher;
851 /* pad string used for password in Standard security handler */
853
854 /* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
855 for 128 bit security */
856 sal_Int32 m_nKeyLength; // key length, 16 or 5
857 sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorithm 3.1
858
859 /* set to true if the following stream must be encrypted, used inside writeBuffer() */
861
862 /* the numerical value of the access permissions, according to PDF spec, must be signed */
864 /* string to hold the PDF creation date */
866 /* string to hold the PDF creation date, for PDF/A metadata */
868 /* the buffer where the data are encrypted, dynamically allocated */
869 std::vector<sal_uInt8> m_vEncryptionBuffer;
870
871 void addRoleMap(OString aAlias, PDFWriter::StructElement eType);
872
873 /* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
874 void checkAndEnableStreamEncryption( sal_Int32 nObject ) override;
875
876 void disableStreamEncryption() override { m_bEncryptThisStream = false; };
877
878 /* */
879 void enableStringEncryption( sal_Int32 nObject );
880
881// test if the encryption is active, if yes than encrypt the unicode string and add to the OStringBuffer parameter
882 void appendUnicodeTextStringEncrypt( const OUString& rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer );
883
884 void appendLiteralStringEncrypt( std::u16string_view rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc = RTL_TEXTENCODING_ASCII_US );
885 void appendLiteralStringEncrypt( std::string_view rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer );
886
887 /* creates fonts and subsets that will be emitted later */
888 void registerGlyph(const sal_GlyphId, const vcl::font::PhysicalFontFace*, const LogicalFontInstance* pFont, const std::vector<sal_Ucs>&, sal_Int32, sal_uInt8&, sal_Int32&);
889 void registerSimpleGlyph(const sal_GlyphId, const vcl::font::PhysicalFontFace*, const std::vector<sal_Ucs>&, sal_Int32, sal_uInt8&, sal_Int32&);
890
891 /* emits a text object according to the passed layout */
892 /* TODO: remove rText as soon as SalLayout will change so that rText is not necessary anymore */
893 void drawVerticalGlyphs( const std::vector<PDFGlyph>& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, const Matrix3& rRotScale, double fAngle, double fXScale, sal_Int32 nFontHeight );
894 void drawHorizontalGlyphs( const std::vector<PDFGlyph>& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, bool bFirst, double fAngle, double fXScale, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight );
895 void drawLayout( SalLayout& rLayout, const OUString& rText, bool bTextLines );
896 void drawRelief( SalLayout& rLayout, const OUString& rText, bool bTextLines );
897 void drawShadow( SalLayout& rLayout, const OUString& rText, bool bTextLines );
898
899 /* writes differences between graphics stack and current real PDF
900 * state to the file
901 */
903
904 /* writes a transparency group object */
906
907 /* writes an XObject of type image, may create
908 a second for the mask
909 */
910 bool writeBitmapObject( const BitmapEmit& rObject, bool bMask = false );
911
912 void writeJPG( const JPGEmit& rEmit );
915
916 /* tries to find the bitmap by its id and returns its emit data if exists,
917 else creates a new emit data block */
918 const BitmapEmit& createBitmapEmit( const BitmapEx& rBitmapEx, const Graphic& rGraphic, std::list<BitmapEmit>& rBitmaps, ResourceDict& rResourceDict, std::list<StreamRedirect>& rOutputStreams );
919 const BitmapEmit& createBitmapEmit( const BitmapEx& rBitmapEx, const Graphic& rGraphic );
920
921 /* writes the Do operation inside the content stream */
922 void drawBitmap( const Point& rDestPt, const Size& rDestSize, const BitmapEmit& rBitmap, const Color& rFillColor );
923 /* write the function object for a Gradient */
924 bool writeGradientFunction( GradientEmit const & rObject );
925 /* creates a GradientEmit and returns its object number */
926 sal_Int32 createGradient( const Gradient& rGradient, const Size& rSize );
927
928 /* writes all tilings */
929 bool emitTilings();
930 /* writes all gradient patterns */
931 bool emitGradients();
932 /* writes a builtin font object and returns its objectid (or 0 in case of failure ) */
933 sal_Int32 emitBuildinFont( const pdf::BuildinFontFace*, sal_Int32 nObject );
934 /* writes a type1 system font object and returns its mapping from font ids to object ids (or 0 in case of failure ) */
935 std::map< sal_Int32, sal_Int32 > emitSystemFont(const vcl::font::PhysicalFontFace*, EmbedFont const &);
936 /* writes a type3 font object and appends it to the font id mapping, or returns false in case of failure */
937 bool emitType3Font(const vcl::font::PhysicalFontFace*, const FontSubset&, std::map<sal_Int32, sal_Int32>&);
938 /* writes a font descriptor and returns its object id (or 0) */
939 sal_Int32 emitFontDescriptor(const vcl::font::PhysicalFontFace*, FontSubsetInfo const &, sal_Int32 nSubsetID, sal_Int32 nStream);
940 /* writes a ToUnicode cmap, returns the corresponding stream object */
941 sal_Int32 createToUnicodeCMap( sal_uInt8 const * pEncoding, const std::vector<sal_Ucs>& CodeUnits, const sal_Int32* pCodeUnitsPerGlyph,
942 const sal_Int32* pEncToUnicodeIndex, uint32_t nGlyphs );
943
944 /* get resource dict object number */
946 {
947 if( m_nResourceDict <= 0 )
949 return m_nResourceDict;
950 }
951 /* get the font dict object */
953 {
954 if( m_nFontDictObject <= 0 )
956 return m_nFontDictObject;
957 }
958 /* push resource into current (redirected) resource dict */
959 static void pushResource( ResourceKind eKind, const OString& rResource, sal_Int32 nObject, ResourceDict& rResourceDict, std::list<StreamRedirect>& rOutputStreams );
960 void pushResource( ResourceKind eKind, const OString& rResource, sal_Int32 nObject );
961
962 void appendBuildinFontsToDict( OStringBuffer& rDict ) const;
963 /* writes the font dictionary and emits all font objects
964 * returns object id of font directory (or 0 on error)
965 */
966 bool emitFonts();
967 /* writes the Resource dictionary;
968 * returns dict object id (or 0 on error)
969 */
970 sal_Int32 emitResources();
971 // appends a dest
972 bool appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer );
973 // write all links
974 bool emitLinkAnnotations();
975 // Write all screen annotations.
977
978 void emitTextAnnotationLine(OStringBuffer & aLine, PDFNoteEntry const & rNote);
979 static void emitPopupAnnotationLine(OStringBuffer & aLine, PDFPopupAnnotation const & rPopUp);
980 // write all notes
981 bool emitNoteAnnotations();
982
983 // write the appearance streams of a widget
984 bool emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDict );
985 // clean up radio button "On" values
987 // write all widgets
989 // writes all annotation objects
990 bool emitAnnotations();
992 bool emitEmbeddedFiles();
993 //write the named destination stuff
994 sal_Int32 emitNamedDestinations();//i56629
995 // writes outline dict and tree
996 sal_Int32 emitOutline();
997 template<typename T> void AppendAnnotKid(PDFStructureElement& i_rEle, T & rAnnot);
998 // puts the attribute objects of a structure element into the returned string,
999 // helper for emitStructure
1001 //--->i94258
1002 // the maximum array elements allowed for PDF array object
1003 static const sal_uInt32 ncMaxPDFArraySize = 8191;
1004 //check if internal dummy container are needed in the structure elements
1006 //<---i94258
1007 // writes document structure
1008 sal_Int32 emitStructure( PDFStructureElement& rEle );
1009 // writes structure parent tree
1010 sal_Int32 emitStructParentTree( sal_Int32 nTreeObject );
1011 // writes structure IDTree
1012 sal_Int32 emitStructIDTree(sal_Int32 nTreeObject);
1013 // writes page tree and catalog
1014 bool emitCatalog();
1015 // writes signature dictionary object
1017 // creates a PKCS7 object using the ByteRange and overwrite /Contents
1018 // of the signature dictionary
1020 // writes xref and trailer
1021 bool emitTrailer();
1022 // emits info dict (if applicable)
1023 sal_Int32 emitInfoDict( );
1024
1025 // acrobat reader 5 and 6 use the order of the annotations
1026 // as their tab order; since PDF1.5 one can make the
1027 // tab order explicit by using the structure tree
1028 void sortWidgets();
1029
1030 // updates the count numbers of outline items
1031 sal_Int32 updateOutlineItemCount( std::vector< sal_Int32 >& rCounts,
1032 sal_Int32 nItemLevel,
1033 sal_Int32 nCurrentItemId );
1034 // default appearances for widgets
1035 sal_Int32 findRadioGroupWidget( const PDFWriter::RadioButtonWidget& rRadio );
1036 Font replaceFont( const Font& rControlFont, const Font& rAppSetFont );
1037 sal_Int32 getBestBuildinFont( const Font& rFont );
1038 sal_Int32 getSystemFont( const Font& i_rFont );
1039
1040 // used for edit and listbox
1042
1048
1049 /* ensure proper escapement and uniqueness of field names */
1050 void createWidgetFieldName( sal_Int32 i_nWidgetsIndex, const PDFWriter::AnyWidget& i_rInWidget );
1052 sal_Int32 createObject() override;
1054 bool updateObject( sal_Int32 n ) override;
1055
1057 bool writeBufferBytes( const void* pBuffer, sal_uInt64 nBytes ) override;
1058 void beginCompression();
1059 void endCompression();
1060 void beginRedirect( SvStream* pStream, const tools::Rectangle& );
1062
1063 void endPage();
1064
1066 enum class EndMode { Default, OnlyStruct };
1076 bool checkEmitStructure();
1077
1078 /* draws an emphasis mark */
1079 void drawEmphasisMark( tools::Long nX, tools::Long nY, const tools::PolyPolygon& rPolyPoly, bool bPolyLine, const tools::Rectangle& rRect1, const tools::Rectangle& rRect2 );
1080
1081 /* true if PDF/A-1a or PDF/A-1b is output */
1083 /* true if PDF/A-2a is output */
1085
1086 /* PDF/UA support enabled */
1088
1090
1092
1093 /*
1094 i12626
1095 methods for PDF security
1096
1097 pad a password according algorithm 3.2, step 1 */
1098 static void padPassword( std::u16string_view i_rPassword, sal_uInt8* o_pPaddedPW );
1099 /* algorithm 3.2: compute an encryption key */
1102 sal_Int32 i_nAccessPermissions
1103 );
1104 /* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
1105 static bool computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword, const sal_uInt8* i_pPaddedUserPassword,
1106 std::vector< sal_uInt8 >& io_rOValue,
1107 sal_Int32 i_nKeyLength
1108 );
1109 /* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
1110 static bool computeUDictionaryValue( EncHashTransporter* i_pTransporter,
1112 sal_Int32 i_nKeyLength,
1113 sal_Int32 i_nAccessPermissions
1114 );
1115
1116 static void computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
1117 const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
1118 const OString& i_rCString1,
1119 OString& o_rCString2
1120 );
1121 static sal_Int32 computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
1122 sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength );
1123 void setupDocInfo();
1124 bool prepareEncryption( const css::uno::Reference< css::beans::XMaterialHolder >& );
1125
1126 // helper for playMetafile
1127 void implWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient,
1129 void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx, const Graphic& i_pGraphic,
1130 VirtualDevice const * pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
1131
1132 // helpers for CCITT 1bit bitmap stream
1133 void putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState );
1134 void putG4Span( tools::Long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState );
1135 void writeG4Stream( BitmapReadAccess const * i_pBitmap );
1136
1137 // color helper functions
1138 void appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer );
1139 void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer );
1140public:
1141 PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >&, PDFWriter& );
1142 ~PDFWriterImpl() override;
1143 void dispose() override;
1144
1145 static css::uno::Reference< css::beans::XMaterialHolder >
1146 initEncryption( const OUString& i_rOwnerPassword,
1147 const OUString& i_rUserPassword );
1148
1149 /* document structure */
1150 void newPage( double nPageWidth , double nPageHeight, PDFWriter::Orientation eOrientation );
1151 bool emit();
1152 const std::set< PDFWriter::ErrorCode > & getErrors() const { return m_aErrors;}
1153 void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); }
1155
1157 {
1158 Size aSize;
1161 return aSize;
1162 }
1163
1164 void setDocumentLocale( const css::lang::Locale& rLoc )
1165 { m_aContext.DocumentLocale = rLoc; }
1166
1167 /* graphics state */
1168 void push( PushFlags nFlags );
1169 void pop();
1170
1171 void setFont( const Font& rFont );
1172
1173 void setMapMode( const MapMode& rMapMode );
1174
1175 const MapMode& getMapMode() { return m_aGraphicsStack.front().m_aMapMode; }
1176
1177 void setLineColor( const Color& rColor )
1178 {
1179 m_aGraphicsStack.front().m_aLineColor = rColor.IsTransparent() ? COL_TRANSPARENT : rColor;
1180 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::LineColor;
1181 }
1182
1183 void setFillColor( const Color& rColor )
1184 {
1185 m_aGraphicsStack.front().m_aFillColor = rColor.IsTransparent() ? COL_TRANSPARENT : rColor;
1186 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::FillColor;
1187 }
1188
1190 {
1191 m_aGraphicsStack.front().m_aTextLineColor = COL_TRANSPARENT;
1192 }
1193
1194 void setTextLineColor( const Color& rColor )
1195 {
1196 m_aGraphicsStack.front().m_aTextLineColor = rColor;
1197 }
1198
1200 {
1201 m_aGraphicsStack.front().m_aOverlineColor = COL_TRANSPARENT;
1202 }
1203
1204 void setOverlineColor( const Color& rColor )
1205 {
1206 m_aGraphicsStack.front().m_aOverlineColor = rColor;
1207 }
1208
1209 void setTextFillColor( const Color& rColor )
1210 {
1211 m_aGraphicsStack.front().m_aFont.SetFillColor( rColor );
1212 m_aGraphicsStack.front().m_aFont.SetTransparent( rColor.IsTransparent() );
1213 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1214 }
1216 {
1217 m_aGraphicsStack.front().m_aFont.SetFillColor( COL_TRANSPARENT );
1218 m_aGraphicsStack.front().m_aFont.SetTransparent( true );
1219 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1220 }
1221 void setTextColor( const Color& rColor )
1222 {
1223 m_aGraphicsStack.front().m_aFont.SetColor( rColor );
1224 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1225 }
1226
1228 {
1229 m_aGraphicsStack.front().m_aClipRegion.clear();
1230 m_aGraphicsStack.front().m_bClipRegion = false;
1232 }
1233
1234 void setClipRegion( const basegfx::B2DPolyPolygon& rRegion );
1235
1236 void moveClipRegion( sal_Int32 nX, sal_Int32 nY );
1237
1238 void intersectClipRegion( const tools::Rectangle& rRect );
1239
1240 void intersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
1241
1243 {
1244 m_aGraphicsStack.front().m_nLayoutMode = nLayoutMode;
1246 }
1247
1249 {
1250 m_aGraphicsStack.front().m_aDigitLanguage = eLang;
1252 }
1253
1255 {
1256 m_aGraphicsStack.front().m_aFont.SetAlignment( eAlign );
1257 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1258 }
1259
1260 /* actual drawing functions */
1261 void drawText( const Point& rPos, const OUString& rText, sal_Int32 nIndex, sal_Int32 nLen, bool bTextLines = true );
1262 void drawTextArray( const Point& rPos, const OUString& rText, KernArraySpan pDXArray, o3tl::span<const sal_Bool> pKashidaArray, sal_Int32 nIndex, sal_Int32 nLen );
1263 void drawStretchText( const Point& rPos, sal_Int32 nWidth, const OUString& rText,
1264 sal_Int32 nIndex, sal_Int32 nLen );
1265 void drawText( const tools::Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle );
1266 void drawTextLine( const Point& rPos, tools::Long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline, bool bUnderlineAbove );
1267 void drawWaveTextLine( OStringBuffer& aLine, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
1268 void drawStraightTextLine( OStringBuffer& aLine, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
1269 void drawStrikeoutLine( OStringBuffer& aLine, tools::Long nWidth, FontStrikeout eStrikeout, Color aColor );
1270 void drawStrikeoutChar( const Point& rPos, tools::Long nWidth, FontStrikeout eStrikeout );
1271
1272 void drawLine( const Point& rStart, const Point& rStop );
1273 void drawLine( const Point& rStart, const Point& rStop, const LineInfo& rInfo );
1274 void drawPolygon( const tools::Polygon& rPoly );
1275 void drawPolyPolygon( const tools::PolyPolygon& rPolyPoly );
1276 void drawPolyLine( const tools::Polygon& rPoly );
1277 void drawPolyLine( const tools::Polygon& rPoly, const LineInfo& rInfo );
1278 void drawPolyLine( const tools::Polygon& rPoly, const PDFWriter::ExtLineInfo& rInfo );
1279
1280 void drawPixel( const Point& rPt, const Color& rColor );
1281
1282 void drawRectangle( const tools::Rectangle& rRect );
1283 void drawRectangle( const tools::Rectangle& rRect, sal_uInt32 nHorzRound, sal_uInt32 nVertRound );
1284 void drawEllipse( const tools::Rectangle& rRect );
1285 void drawArc( const tools::Rectangle& rRect, const Point& rStart, const Point& rStop, bool bWithPie, bool bWidthChord );
1286
1287 void drawBitmap( const Point& rDestPoint, const Size& rDestSize, const Bitmap& rBitmap, const Graphic& rGraphic );
1288 void drawBitmap( const Point& rDestPoint, const Size& rDestSize, const BitmapEx& rBitmap );
1289 void drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const Size& rSizePixel, const tools::Rectangle& rTargetArea, const AlphaMask& rAlphaMask, const Graphic& rGraphic );
1291 void createEmbeddedFile(const Graphic& rGraphic, ReferenceXObjectEmit& rEmit, sal_Int32 nBitmapObject);
1292
1293 void drawGradient( const tools::Rectangle& rRect, const Gradient& rGradient );
1294 void drawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch );
1295 void drawWallpaper( const tools::Rectangle& rRect, const Wallpaper& rWall );
1296 void drawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt32 nTransparentPercent );
1298 void endTransparencyGroup( const tools::Rectangle& rBoundingBox, sal_uInt32 nTransparentPercent );
1299
1300 void emitComment( const char* pComment );
1301
1302 //--->i56629 named destinations
1303 sal_Int32 createNamedDest( const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType );
1304
1305 //--->i59651
1306 //emits output intent
1307 sal_Int32 emitOutputIntent();
1308
1309 //emits the document metadata
1310 sal_Int32 emitDocumentMetadata();
1311
1312 // links
1313 sal_Int32 createLink(const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString const& rAltText);
1314 sal_Int32 createDest( const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType );
1315 sal_Int32 registerDestReference( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType );
1316 void setLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
1317 void setLinkURL( sal_Int32 nLinkId, const OUString& rURL );
1318 void setLinkPropertyId( sal_Int32 nLinkId, sal_Int32 nPropertyId );
1319
1320 // screens
1321 sal_Int32 createScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString const& rAltText, OUString const& rMimeType);
1322 void setScreenURL(sal_Int32 nScreenId, const OUString& rURL);
1323 void setScreenStream(sal_Int32 nScreenId, const OUString& rURL);
1324
1325 // outline
1326 sal_Int32 createOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID );
1327 void setOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
1328 void setOutlineItemText( sal_Int32 nItem, std::u16string_view rText );
1329 void setOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
1330
1331 // notes
1332 void createNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr );
1333 // structure elements
1334 sal_Int32 ensureStructureElement();
1335 void initStructureElement(sal_Int32 id, PDFWriter::StructElement eType, std::u16string_view rAlias);
1336 void beginStructureElement(sal_Int32 id);
1337 void endStructureElement();
1338 bool setCurrentStructureElement( sal_Int32 nElement );
1340 bool setStructureAttributeNumerical( enum PDFWriter::StructAttribute eAttr, sal_Int32 nValue );
1341 void setStructureBoundingBox( const tools::Rectangle& rRect );
1342 void setStructureAnnotIds(::std::vector<sal_Int32> const& rAnnotIds);
1343 void setActualText( const OUString& rText );
1344 void setAlternateText( const OUString& rText );
1345
1346 // transitional effects
1347 void setPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1348
1349 // controls
1350 sal_Int32 createControl( const PDFWriter::AnyWidget& rControl, sal_Int32 nPageNr = -1 );
1351
1352 // attached file
1353 void addDocumentAttachedFile(OUString const& rFileName, OUString const& rMimeType, OUString const& rDescription, std::unique_ptr<PDFOutputStream> rStream);
1354
1355 sal_Int32 addEmbeddedFile(BinaryDataContainer const & rDataContainer);
1356 sal_Int32 addEmbeddedFile(std::unique_ptr<PDFOutputStream> rStream, OUString const& rMimeType);
1357
1358 // helper: eventually begin marked content sequence and
1359 // emit a comment in debug case
1360 void MARK( const char* pString );
1361};
1362
1363} // namespace vcl
1364
1365/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DrawTextFlags
sal_uInt64 BitmapChecksum
Definition: checksum.hxx:30
Container for the binary data, whose responsibility is to manage the make it as simple as possible to...
bool IsTransparent() const
Definition: hatch.hxx:47
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
Definition: vclptr.hxx:58
Allows creating, updating and writing PDF objects in a container.
static void computeDocumentIdentifier(std::vector< sal_uInt8 > &o_rIdentifier, const vcl::PDFWriter::PDFDocInfo &i_rDocInfo, const OString &i_rCString1, OString &o_rCString2)
std::list< GradientEmit > m_aGradients
void setDocumentLocale(const css::lang::Locale &rLoc)
sal_Int64 m_nSignatureContentOffset
void drawWallpaper(const tools::Rectangle &rRect, const Wallpaper &rWall)
void setTextAlign(TextAlign eAlign)
std::map< sal_Int32, sal_Int32 > m_aLinkPropertyMap
void moveClipRegion(sal_Int32 nX, sal_Int32 nY)
void setLayoutMode(vcl::text::ComplexTextLayoutFlags nLayoutMode)
sal_Int64 m_nSignatureLastByteRangeNoOffset
bool updateObject(sal_Int32 n) override
See vcl::PDFObjectContainer::updateObject().
void beginStructureElement(sal_Int32 id)
void drawEllipse(const tools::Rectangle &rRect)
static bool computeODictionaryValue(const sal_uInt8 *i_pPaddedOwnerPassword, const sal_uInt8 *i_pPaddedUserPassword, std::vector< sal_uInt8 > &io_rOValue, sal_Int32 i_nKeyLength)
void addInternalStructureContainer(PDFStructureElement &rEle)
void putG4Bits(sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState &io_rState)
void enableStringEncryption(sal_Int32 nObject)
void setFont(const Font &rFont)
sal_Int32 findRadioGroupWidget(const PDFWriter::RadioButtonWidget &rRadio)
void setAlternateText(const OUString &rText)
sal_Int32 emitBuildinFont(const pdf::BuildinFontFace *, sal_Int32 nObject)
sal_Int32 emitStructParentTree(sal_Int32 nTreeObject)
sal_Int32 emitFontDescriptor(const vcl::font::PhysicalFontFace *, FontSubsetInfo const &, sal_Int32 nSubsetID, sal_Int32 nStream)
static void convertLineInfoToExtLineInfo(const LineInfo &rIn, PDFWriter::ExtLineInfo &rOut)
std::set< PDFWriter::ErrorCode > m_aErrors
void ImplRefreshFontData(bool bNewFontLists) override
sal_Int32 addEmbeddedFile(BinaryDataContainer const &rDataContainer)
void createNote(const tools::Rectangle &rRect, const PDFNote &rNote, sal_Int32 nPageNr)
std::map< const vcl::font::PhysicalFontFace *, FontSubset > m_aSubsets
void setActualText(const OUString &rText)
static css::uno::Reference< css::beans::XMaterialHolder > initEncryption(const OUString &i_rOwnerPassword, const OUString &i_rUserPassword)
std::map< const vcl::font::PhysicalFontFace *, EmbedFont > m_aSystemFonts
static void emitPopupAnnotationLine(OStringBuffer &aLine, PDFPopupAnnotation const &rPopUp)
static void padPassword(std::u16string_view i_rPassword, sal_uInt8 *o_pPaddedPW)
void drawPolyLine(const tools::Polygon &rPoly)
std::list< GraphicsState > m_aGraphicsStack
GraphicsState m_aCurrentPDFState
std::map< const vcl::font::PhysicalFontFace *, FontSubset > m_aType3Fonts
std::unordered_map< OString, OString > m_aRoleMap
void createWidgetFieldName(sal_Int32 i_nWidgetsIndex, const PDFWriter::AnyWidget &i_rInWidget)
sal_Int32 createControl(const PDFWriter::AnyWidget &rControl, sal_Int32 nPageNr=-1)
void writeTransparentObject(TransparencyEmit &rObject)
sal_Int32 m_nCurrentStructElement
void drawVerticalGlyphs(const std::vector< PDFGlyph > &rGlyphs, OStringBuffer &rLine, const Point &rAlignOffset, const Matrix3 &rRotScale, double fAngle, double fXScale, sal_Int32 nFontHeight)
const char * getStructureTag(PDFWriter::StructElement)
void drawPolyPolygon(const tools::PolyPolygon &rPolyPoly)
void endStructureElementMCSeq(EndMode=EndMode::Default)
void addRoleMap(OString aAlias, PDFWriter::StructElement eType)
OString emitStructureAttributes(PDFStructureElement &rEle)
std::unordered_set< sal_Int32 > m_StructElemObjsWithID
std::vector< PDFLink > m_aLinks
std::vector< PDFEmbeddedFile > m_aEmbeddedFiles
Contains embedded files.
static sal_Int32 computeAccessPermissions(const vcl::PDFWriter::PDFEncryptionProperties &i_rProperties, sal_Int32 &o_rKeyLength, sal_Int32 &o_rRC4KeyLength)
sal_Int32 createLink(const tools::Rectangle &rRect, sal_Int32 nPageNr, OUString const &rAltText)
void appendLiteralStringEncrypt(std::u16string_view rInString, const sal_Int32 nInObjectNumber, OStringBuffer &rOutBuffer, rtl_TextEncoding nEnc=RTL_TEXTENCODING_ASCII_US)
void setTextLineColor(const Color &rColor)
std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets
void initStructureElement(sal_Int32 id, PDFWriter::StructElement eType, std::u16string_view rAlias)
sal_Int32 ensureStructureElement()
std::list< StreamRedirect > m_aOutputStreams
void drawGradient(const tools::Rectangle &rRect, const Gradient &rGradient)
void drawTextLine(const Point &rPos, tools::Long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline, bool bUnderlineAbove)
OString m_aCreationMetaDateString
void newPage(double nPageWidth, double nPageHeight, PDFWriter::Orientation eOrientation)
static bool computeEncryptionKey(EncHashTransporter *, vcl::PDFWriter::PDFEncryptionProperties &io_rProperties, sal_Int32 i_nAccessPermissions)
void drawStraightTextLine(OStringBuffer &aLine, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove)
void dispose() override
void setOutlineItemDest(sal_Int32 nItem, sal_Int32 nDestID)
bool writeGradientFunction(GradientEmit const &rObject)
void drawText(const Point &rPos, const OUString &rText, sal_Int32 nIndex, sal_Int32 nLen, bool bTextLines=true)
std::map< sal_Int32, sal_Int32 > emitSystemFont(const vcl::font::PhysicalFontFace *, EmbedFont const &)
void createDefaultRadioButtonAppearance(PDFWidget &, const PDFWriter::RadioButtonWidget &rWidget)
void drawStretchText(const Point &rPos, sal_Int32 nWidth, const OUString &rText, sal_Int32 nIndex, sal_Int32 nLen)
void DrawHatchLine_DrawLine(const Point &rStartPoint, const Point &rEndPoint) override
void writeG4Stream(BitmapReadAccess const *i_pBitmap)
PDFWriter::PDFWriterContext m_aContext
void createDefaultPushButtonAppearance(PDFWidget &, const PDFWriter::PushButtonWidget &rWidget)
void drawStrikeoutLine(OStringBuffer &aLine, tools::Long nWidth, FontStrikeout eStrikeout, Color aColor)
void drawHorizontalGlyphs(const std::vector< PDFGlyph > &rGlyphs, OStringBuffer &rLine, const Point &rAlignOffset, bool bFirst, double fAngle, double fXScale, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight)
void setOutlineItemText(sal_Int32 nItem, std::u16string_view rText)
std::list< BitmapEmit > m_aBitmaps
void setTextFillColor(const Color &rColor)
PDFWriterImpl(const PDFWriter::PDFWriterContext &rContext, const css::uno::Reference< css::beans::XMaterialHolder > &, PDFWriter &)
std::vector< PDFNamedDest > m_aNamedDests
bool checkEmitStructure()
checks whether a non struct element lies in the ancestor hierarchy of the current structure element
void setMapMode(const MapMode &rMapMode)
sal_Int32 emitDocumentMetadata()
void setOutlineItemParent(sal_Int32 nItem, sal_Int32 nNewParent)
void checkAndEnableStreamEncryption(sal_Int32 nObject) override
bool emitEmbeddedFiles()
Writes embedded files.
sal_Int32 updateOutlineItemCount(std::vector< sal_Int32 > &rCounts, sal_Int32 nItemLevel, sal_Int32 nCurrentItemId)
void setLinkURL(sal_Int32 nLinkId, const OUString &rURL)
Size getCurPageSize() const
void endTransparencyGroup(const tools::Rectangle &rBoundingBox, sal_uInt32 nTransparentPercent)
std::unique_ptr< SvMemoryStream > m_pMemStream
void disableStreamEncryption() override
::comphelper::Hash m_DocDigest
void setScreenStream(sal_Int32 nScreenId, const OUString &rURL)
void drawArc(const tools::Rectangle &rRect, const Point &rStart, const Point &rStop, bool bWithPie, bool bWidthChord)
void drawStrikeoutChar(const Point &rPos, tools::Long nWidth, FontStrikeout eStrikeout)
void ImplClearFontData(bool bNewFontLists) override
std::vector< PDFPage > m_aPages
void appendBuildinFontsToDict(OStringBuffer &rDict) const
std::vector< sal_uInt8 > m_vEncryptionBuffer
void createDefaultEditAppearance(PDFWidget &, const PDFWriter::EditWidget &rWidget)
StyleSettings m_aWidgetStyleSettings
void insertError(PDFWriter::ErrorCode eErr)
const MapMode & getMapMode()
sal_Int32 getFontDictObject()
void writeReferenceXObject(const ReferenceXObjectEmit &rEmit)
Writes the form XObject proxy for the image.
void setStructureBoundingBox(const tools::Rectangle &rRect)
void createDefaultListBoxAppearance(PDFWidget &, const PDFWriter::ListBoxWidget &rWidget)
std::unordered_map< OString, sal_Int32 > m_aFieldNameMap
std::vector< TransparencyEmit > m_aTransparentObjects
void drawEmphasisMark(tools::Long nX, tools::Long nY, const tools::PolyPolygon &rPolyPoly, bool bPolyLine, const tools::Rectangle &rRect1, const tools::Rectangle &rRect2)
void createEmbeddedFile(const Graphic &rGraphic, ReferenceXObjectEmit &rEmit, sal_Int32 nBitmapObject)
Stores the original PDF data from rGraphic as an embedded file.
static const sal_uInt32 ncMaxPDFArraySize
bool writeBufferBytes(const void *pBuffer, sal_uInt64 nBytes) override
See vcl::PDFObjectContainer::writeBuffer().
void setDigitLanguage(LanguageType eLang)
sal_Int32 createScreen(const tools::Rectangle &rRect, sal_Int32 nPageNr, OUString const &rAltText, OUString const &rMimeType)
bool setStructureAttribute(enum PDFWriter::StructAttribute eAttr, enum PDFWriter::StructAttributeValue eVal)
std::vector< OString > m_aStructParentTree
o3tl::lru_map< BitmapChecksum, std::shared_ptr< SvMemoryStream > > m_aPDFBmpCache
Cache some most recent bitmaps we've exported, in case we encounter them again..
void drawRelief(SalLayout &rLayout, const OUString &rText, bool bTextLines)
const BitmapEmit & createBitmapEmit(const BitmapEx &rBitmapEx, const Graphic &rGraphic, std::list< BitmapEmit > &rBitmaps, ResourceDict &rResourceDict, std::list< StreamRedirect > &rOutputStreams)
std::vector< PDFDocumentAttachedFile > m_aDocumentAttachedFiles
void appendStrokingColor(const Color &rColor, OStringBuffer &rBuffer)
void setLinkPropertyId(sal_Int32 nLinkId, sal_Int32 nPropertyId)
void playMetafile(const GDIMetaFile &, vcl::PDFExtOutDevData *, const vcl::PDFWriter::PlayMetafileContext &, VirtualDevice *pDummyDev=nullptr)
static const char * getAttributeTag(PDFWriter::StructAttribute eAtr)
sal_Int32 getBestBuildinFont(const Font &rFont)
void drawJPGBitmap(SvStream &rDCTData, bool bIsTrueColor, const Size &rSizePixel, const tools::Rectangle &rTargetArea, const AlphaMask &rAlphaMask, const Graphic &rGraphic)
void setStructureAnnotIds(::std::vector< sal_Int32 > const &rAnnotIds)
sal_Int32 createNamedDest(const OUString &sDestName, const tools::Rectangle &rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType)
void drawHatch(const tools::PolyPolygon &rPolyPoly, const Hatch &rHatch)
void drawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt32 nTransparentPercent)
std::stack< sal_Int32 > m_StructElementStack
sal_Int32 emitStructure(PDFStructureElement &rEle)
void push(PushFlags nFlags)
void setScreenURL(sal_Int32 nScreenId, const OUString &rURL)
std::vector< sal_uInt64 > m_aObjects
void AppendAnnotKid(PDFStructureElement &i_rEle, T &rAnnot)
Font drawFieldBorder(PDFWidget &, const PDFWriter::AnyWidget &, const StyleSettings &)
void implWriteGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient, VirtualDevice *pDummyVDev, const vcl::PDFWriter::PlayMetafileContext &)
std::vector< TilingEmit > m_aTilings
std::map< sal_Int32, sal_Int32 > m_aBuildinFontToObjectMap
bool ImplNewFont() const override
sal_Int32 m_nAccessPermissions
void beginRedirect(SvStream *pStream, const tools::Rectangle &)
sal_Int32 emitOutputIntent()
void setOverlineColor(const Color &rColor)
sal_Int32 createGradient(const Gradient &rGradient, const Size &rSize)
sal_Int32 createObject() override
See vcl::PDFObjectContainer::createObject().
bool setCurrentStructureElement(sal_Int32 nElement)
void appendNonStrokingColor(const Color &rColor, OStringBuffer &rBuffer)
void createDefaultCheckBoxAppearance(PDFWidget &, const PDFWriter::CheckBoxWidget &rWidget)
void drawLine(const Point &rStart, const Point &rStop)
std::vector< PDFDest > m_aDests
void setFillColor(const Color &rColor)
void drawTextArray(const Point &rPos, const OUString &rText, KernArraySpan pDXArray, o3tl::span< const sal_Bool > pKashidaArray, sal_Int32 nIndex, sal_Int32 nLen)
void drawRectangle(const tools::Rectangle &rRect)
void drawLayout(SalLayout &rLayout, const OUString &rText, bool bTextLines)
sal_Int32 emitStructIDTree(sal_Int32 nTreeObject)
void setTextColor(const Color &rColor)
std::vector< PDFStructureElement > m_aStructure
void appendUnicodeTextStringEncrypt(const OUString &rInString, const sal_Int32 nInObjectNumber, OStringBuffer &rOutBuffer)
std::vector< JPGEmit > m_aJPGs
sal_Int32 m_nSignatureObject
bool setStructureAttributeNumerical(enum PDFWriter::StructAttribute eAttr, sal_Int32 nValue)
void drawBitmap(const Point &rDestPt, const Size &rDestSize, const BitmapEmit &rBitmap, const Color &rFillColor)
sal_Int32 getSystemFont(const Font &i_rFont)
void addDocumentAttachedFile(OUString const &rFileName, OUString const &rMimeType, OUString const &rDescription, std::unique_ptr< PDFOutputStream > rStream)
std::vector< PDFScreen > m_aScreens
Contains all screen annotations.
static const char * getAttributeValueTag(PDFWriter::StructAttributeValue eVal)
void drawShadow(SalLayout &rLayout, const OUString &rText, bool bTextLines)
void writeJPG(const JPGEmit &rEmit)
void putG4Span(tools::Long i_nSpan, bool i_bWhitePixel, BitStreamState &io_rState)
bool prepareEncryption(const css::uno::Reference< css::beans::XMaterialHolder > &)
bool appendDest(sal_Int32 nDestID, OStringBuffer &rBuffer)
std::vector< PDFNoteEntry > m_aNotes
void setPageTransition(PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr)
void MARK(const char *pString)
void emitComment(const char *pComment)
sal_Int32 createToUnicodeCMap(sal_uInt8 const *pEncoding, const std::vector< sal_Ucs > &CodeUnits, const sal_Int32 *pCodeUnitsPerGlyph, const sal_Int32 *pEncToUnicodeIndex, uint32_t nGlyphs)
ExternalPDFStreams m_aExternalPDFStreams
sal_Int32 registerDestReference(sal_Int32 nDestId, const tools::Rectangle &rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType)
sal_Int32 createOutlineItem(sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID)
void emitTextAnnotationLine(OStringBuffer &aLine, PDFNoteEntry const &rNote)
sal_Int32 getResourceDictObj()
ResourceDict m_aGlobalResourceDict
sal_Int32 createDest(const tools::Rectangle &rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType)
bool emitAppearances(PDFWidget &rWidget, OStringBuffer &rAnnotDict)
void intersectClipRegion(const tools::Rectangle &rRect)
vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override
Perform actual rect clip against outdev dimensions, to generate empty clips whenever one of the value...
void implWriteBitmapEx(const Point &rPoint, const Size &rSize, const BitmapEx &rBitmapEx, const Graphic &i_pGraphic, VirtualDevice const *pDummyVDev, const vcl::PDFWriter::PlayMetafileContext &)
void setLineColor(const Color &rColor)
void setLinkDest(sal_Int32 nLinkId, sal_Int32 nDestId)
static void pushResource(ResourceKind eKind, const OString &rResource, sal_Int32 nObject, ResourceDict &rResourceDict, std::list< StreamRedirect > &rOutputStreams)
void updateGraphicsState(Mode mode=Mode::DEFAULT)
css::uno::Reference< css::util::XURLTransformer > m_xTrans
void registerGlyph(const sal_GlyphId, const vcl::font::PhysicalFontFace *, const LogicalFontInstance *pFont, const std::vector< sal_Ucs > &, sal_Int32, sal_uInt8 &, sal_Int32 &)
void drawWaveTextLine(OStringBuffer &aLine, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove)
std::vector< PDFWidget > m_aWidgets
static bool compressStream(SvMemoryStream *)
sal_uInt64 getCurrentFilePosition()
void setClipRegion(const basegfx::B2DPolyPolygon &rRegion)
sal_Int32 emitNamedDestinations()
bool writeBitmapObject(const BitmapEmit &rObject, bool bMask=false)
static bool computeUDictionaryValue(EncHashTransporter *i_pTransporter, vcl::PDFWriter::PDFEncryptionProperties &io_rProperties, sal_Int32 i_nKeyLength, sal_Int32 i_nAccessPermissions)
static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE]
bool emitType3Font(const vcl::font::PhysicalFontFace *, const FontSubset &, std::map< sal_Int32, sal_Int32 > &)
::std::map< sal_Int32, sal_Int32 > m_aDestinationIdTranslation
contains destinations accessible via a public Id, instead of being linked to by an ordinary link
Font replaceFont(const Font &rControlFont, const Font &rAppSetFont)
SvStream * endRedirect()
void drawPolygon(const tools::Polygon &rPoly)
const std::set< PDFWriter::ErrorCode > & getErrors() const
std::vector< PDFOutlineEntry > m_aOutline
std::unique_ptr< ZCodec > m_pCodec
void registerSimpleGlyph(const sal_GlyphId, const vcl::font::PhysicalFontFace *, const std::vector< sal_Ucs > &, sal_Int32, sal_uInt8 &, sal_Int32 &)
void drawPixel(const Point &rPt, const Color &rColor)
abstract base class for physical font faces
const std::vector< ColorLayer > & getColorLayers() const
font::RawFontData m_aColorBitmap
void setOutline(basegfx::B2DPolyPolygon aOutline)
void addCode(sal_Ucs i_cCode)
tools::Rectangle m_aRect
const basegfx::B2DPolyPolygon & getOutline() const
const font::RawFontData & getColorBitmap(tools::Rectangle &rRect) const
void setColorBitmap(font::RawFontData aData, tools::Rectangle aRect)
std::vector< sal_Ucs > m_CodeUnits
const std::vector< sal_Ucs > & codes() const
void addColorLayer(ColorLayer aLayer)
void setGlyphWidth(sal_Int32 nWidth)
basegfx::B2DPolyPolygon m_aOutline
void setGlyphId(sal_uInt8 i_nId)
sal_Ucs getCode(sal_Int32 i_nIndex) const
sal_Int32 countCodes() const
std::vector< ColorLayer > m_aColorLayers
sal_Int32 getGlyphWidth() const
sal_uInt8 getGlyphId() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
FontLineStyle
FontStrikeout
uint32_t sal_GlyphId
Definition: glyphid.hxx:24
def text(shape, orig_st)
constexpr OUStringLiteral aData
NONE
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
FormatType
TextAlign
long Long
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
constexpr sal_Int32 g_nInheritedPageWidth
constexpr sal_Int32 g_nInheritedPageHeight
ComplexTextLayoutFlags
Definition: State.hxx:76
PushFlags
Definition: State.hxx:40
constexpr sal_Int32 MAXIMUM_RC4_KEY_LENGTH
constexpr sal_Int32 MD5_DIGEST_SIZE
constexpr sal_Int32 ENCRYPTED_PWD_SIZE
constexpr sal_Int32 SECUR_128BIT_KEY
sal_Unicode sal_Ucs
Definition: salgdi.hxx:64
Homogeneous 2D transformation matrix.
css::lang::Locale DocumentLocale
Definition: pdfwriter.hxx:636
Play a metafile like an outputdevice would do.
Definition: pdfwriter.hxx:701
ReferenceXObjectEmit m_aReferenceXObject
LogicalFontInstance * m_pFontInstance
std::map< sal_GlyphId, GlyphEmit > m_aMapping
FontEmit(sal_Int32 nID)
std::vector< FontEmit > m_aSubsets
std::map< sal_GlyphId, Glyph > m_aMapping
sal_uInt8 m_nSubsetGlyphID
vcl::text::ComplexTextLayoutFlags m_nLayoutMode
basegfx::B2DPolyPolygon m_aClipRegion
GraphicsStateUpdateFlags m_nUpdateFlags
std::unique_ptr< SvMemoryStream > m_pStream
ReferenceXObjectEmit m_aReferenceXObject
tools::Rectangle m_aRect
PDFWriter::DestAreaType m_eType
tools::Rectangle m_aRect
A PDF embedded file.
BinaryDataContainer m_aDataContainer
Contents of the file.
std::unique_ptr< PDFOutputStream > m_pStream
sal_Int32 m_nObject
ID of the file.
basegfx::B2DPoint const m_aPos
sal_uInt8 const m_nMappedGlyphId
sal_Int32 const m_nMappedFontId
const LogicalFontInstance * m_pFont
sal_Int32 const m_nNativeWidth
const GlyphItem * m_pGlyph
PDFGlyph(const basegfx::B2DPoint &rPos, const GlyphItem *pGlyph, const LogicalFontInstance *pFont, sal_Int32 nNativeWidth, sal_Int32 nFontId, sal_uInt8 nMappedGlyphId, int nCharPos)
PDFWriter::DestAreaType m_eType
tools::Rectangle m_aRect
PDFPopupAnnotation m_aPopUpAnnotation
std::vector< sal_Int32 > m_aChildren
PDFPage(PDFWriterImpl *pWriter, double nPageWidth, double nPageHeight, PDFWriter::Orientation eOrientation)
void appendWaveLine(sal_Int32 nLength, sal_Int32 nYOffset, sal_Int32 nDelta, OStringBuffer &rBuffer) const
sal_uInt64 m_nBeginStreamPos
void appendPoint(const Point &rPoint, OStringBuffer &rBuffer) const
void appendPixelPoint(const basegfx::B2DPoint &rPoint, OStringBuffer &rBuffer) const
void convertRect(tools::Rectangle &rRect) const
VclPtr< PDFWriterImpl > m_pWriter
void appendMatrix3(Matrix3 const &rMatrix, OStringBuffer &rBuffer)
std::vector< sal_Int32 > m_aAnnotations
void appendRect(const tools::Rectangle &rRect, OStringBuffer &rBuffer) const
sal_Int32 m_nUserUnit
A positive number that gives the size of default user space units, in multiples of points.
bool appendLineInfo(const LineInfo &rInfo, OStringBuffer &rBuffer) const
std::vector< sal_Int32 > m_aMCIDParents
double getHeight() const
void appendMappedLength(sal_Int32 nLength, OStringBuffer &rBuffer, bool bVertical=true, sal_Int32 *pOutLength=nullptr) const
sal_Int32 m_nStreamLengthObject
bool emit(sal_Int32 nParentPage)
void appendPolygon(const tools::Polygon &rPoly, OStringBuffer &rBuffer, bool bClose=true) const
PDFWriter::Orientation m_eOrientation
std::vector< sal_Int32 > m_aStreamObjects
void appendPolyPolygon(const tools::PolyPolygon &rPolyPoly, OStringBuffer &rBuffer) const
PDFWriter::PageTransition m_eTransition
sal_Int32 m_nParentObject
ID of the parent object.
A PDF Screen annotation.
OUString m_aTempFileURL
Embedded video.
sal_Int32 m_nTempFileObject
ID of the EmbeddedFile object.
OUString m_aURL
Linked video.
PDFScreen(OUString const &rAltText, OUString const &rMimeType)
OUString m_AltText
alternative text description
PDFWriter::StructAttributeValue eValue
PDFStructureAttribute(PDFWriter::StructAttributeValue eVal)
PDFStructureElementKid(sal_Int32 MCID, sal_Int32 nPage)
::std::vector< sal_Int32 > m_AnnotIds
std::map< PDFWriter::StructAttribute, PDFStructureAttribute > m_aAttributes
std::vector< sal_Int32 > m_aChildren
std::list< PDFStructureElementKid > m_aKids
::std::optional< PDFWriter::StructElement > m_oType
DrawTextFlags m_nTextStyle
std::unordered_map< OString, PDFAppearanceStreams > m_aAppearances
PDFWriter::WidgetType m_eType
std::vector< sal_Int32 > m_aKidsIndex
std::vector< sal_Int32 > m_aKids
std::unordered_map< OString, SvMemoryStream * > PDFAppearanceStreams
PDFWriter::FormatType m_nFormat
std::vector< OUString > m_aListEntries
std::vector< sal_Int32 > m_aSelectedEntries
Contains information to emit a reference XObject.
sal_Int32 m_nEmbeddedObject
ID of the vector/embedded object, if m_nFormObject is used.
sal_Int32 m_nFormObject
ID of the Form XObject, if any.
sal_Int32 getObject() const
Returns the ID one should use when referring to this bitmap.
sal_Int32 m_nBitmapObject
ID of the bitmap object, if m_nFormObject is used.
sal_Int32 m_nExternalPDFDataIndex
PDF data from the graphic object, if not writing a reference XObject.
Size m_aPixelSize
Size of the bitmap replacement, in pixels.
tools::Rectangle m_aTargetRect
tools::Rectangle m_aRectangle
std::unique_ptr< SvMemoryStream > m_pTilingStream
SvtGraphicFill::Transform m_aTransform
std::unique_ptr< SvMemoryStream > m_pContentStream
unsigned char sal_uInt8