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
32#include <pdf/ResourceDict.hxx>
33#include <pdf/BitmapID.hxx>
34#include <pdf/Matrix3.hxx>
35
36#include <com/sun/star/lang/Locale.hpp>
37#include <com/sun/star/util/XURLTransformer.hpp>
38#include <com/sun/star/uno/Sequence.h>
39#include <osl/file.hxx>
40#include <rtl/cipher.h>
41#include <rtl/strbuf.hxx>
42#include <rtl/ustring.hxx>
43#include <tools/gen.hxx>
44#include <vcl/bitmapex.hxx>
45#include <vcl/gradient.hxx>
46#include <vcl/graphictools.hxx>
47#include <vcl/hatch.hxx>
48#include <vcl/virdev.hxx>
49#include <vcl/pdfwriter.hxx>
50#include <vcl/wall.hxx>
51#include <o3tl/safeint.hxx>
53#include <o3tl/lru_map.hxx>
54#include <comphelper/hash.hxx>
55#include <tools/stream.hxx>
57
59#include <vcl/settings.hxx>
62#include <salgdi.hxx>
63
64class FontSubsetInfo;
65class ZCodec;
67struct BitStreamState;
68namespace vcl::font { class PhysicalFontFace; }
69class SvStream;
70class SvMemoryStream;
71
72// the maximum password length
73constexpr sal_Int32 ENCRYPTED_PWD_SIZE = 32;
74constexpr sal_Int32 MD5_DIGEST_SIZE = 16;
75// security 128 bit
76constexpr sal_Int32 SECUR_128BIT_KEY = 16;
77// maximum length of MD5 digest input, in step 2 of algorithm 3.1
78// PDF spec ver. 1.4: see there for details
79constexpr sal_Int32 MAXIMUM_RC4_KEY_LENGTH = SECUR_128BIT_KEY + 3 + 2;
80
81namespace vcl::pdf
82{
83
85 Font = 0x0001,
86 MapMode = 0x0002,
87 LineColor = 0x0004,
88 FillColor = 0x0008,
89 ClipRegion = 0x0040,
90 LayoutMode = 0x0100,
91 TransparentPercent = 0x0200,
92 DigitLanguage = 0x0400,
93 All = 0x077f
94};
95
96} // end vcl::pdf
97
98namespace o3tl {
99 template<> struct typed_flags<vcl::pdf::GraphicsStateUpdateFlags> : is_typed_flags<vcl::pdf::GraphicsStateUpdateFlags, 0x077f> {};
100}
101
102namespace vcl
103{
104
105using namespace vcl::pdf;
106
107class PDFStreamIf;
108
109namespace filter
110{
111class PDFObjectElement;
112}
113
114namespace pdf
115{
116constexpr sal_Int32 g_nInheritedPageWidth = 595; // default A4 in inch/72
117constexpr sal_Int32 g_nInheritedPageHeight = 842; // default A4 in inch/72
118
120{
122 double m_nPageWidth; // in inch/72
123 double m_nPageHeight; // in inch/72
128 sal_Int32 m_nUserUnit;
130 sal_Int32 m_nPageObject;
131 std::vector<sal_Int32> m_aStreamObjects;
134 std::vector<sal_Int32> m_aAnnotations;
135 std::vector<sal_Int32> m_aMCIDParents;
137 sal_uInt32 m_nTransTime;
138
139 PDFPage( PDFWriterImpl* pWriter, double nPageWidth, double nPageHeight, PDFWriter::Orientation eOrientation );
140
141 void beginStream();
142 void endStream();
143 bool emit( sal_Int32 nParentPage );
144
145 // converts point from ref device coordinates to
146 // page coordinates and appends the point to the buffer
147 // if pOutPoint is set it will be updated to the emitted point
148 // (in PDF map mode, that is 10th of point)
149 void appendPoint( const Point& rPoint, OStringBuffer& rBuffer ) const;
150 // appends a B2DPoint without further transformation
151 void appendPixelPoint( const basegfx::B2DPoint& rPoint, OStringBuffer& rBuffer ) const;
152 // appends a rectangle
153 void appendRect( const tools::Rectangle& rRect, OStringBuffer& rBuffer ) const;
154 // converts a rectangle to 10th points page space
155 void convertRect( tools::Rectangle& rRect ) const;
156 // appends a polygon optionally closing it
157 void appendPolygon( const tools::Polygon& rPoly, OStringBuffer& rBuffer, bool bClose = true ) const;
158 // appends a polygon optionally closing it
159 void appendPolygon( const basegfx::B2DPolygon& rPoly, OStringBuffer& rBuffer ) const;
160 // appends a polypolygon optionally closing the subpaths
161 void appendPolyPolygon( const tools::PolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const;
162 // appends a polypolygon optionally closing the subpaths
163 void appendPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const;
164 // converts a length (either vertical or horizontal; this
165 // can be important if the source MapMode is not
166 // symmetrical) to page length and appends it to the buffer
167 // if pOutLength is set it will be updated to the emitted length
168 // (in PDF map mode, that is 10th of point)
169 void appendMappedLength( sal_Int32 nLength, OStringBuffer& rBuffer, bool bVertical = true, sal_Int32* pOutLength = nullptr ) const;
170 // the same for double values
171 void appendMappedLength( double fLength, OStringBuffer& rBuffer, bool bVertical = true, sal_Int32 nPrecision = 5 ) const;
172 // appends LineInfo
173 // returns false if too many dash array entry were created for
174 // the implementation limits of some PDF readers
175 bool appendLineInfo( const LineInfo& rInfo, OStringBuffer& rBuffer ) const;
176 // appends a horizontal waveline with vertical offset (helper for drawWaveLine)
177 void appendWaveLine( sal_Int32 nLength, sal_Int32 nYOffset, sal_Int32 nDelta, OStringBuffer& rBuffer ) const;
178
179 void appendMatrix3(Matrix3 const & rMatrix, OStringBuffer& rBuffer);
180
181 double getHeight() const;
182};
183
186{
188 sal_Int32 m_nFormObject;
198
200 : m_nFormObject(0)
202 , m_nBitmapObject(0)
205 {
206 }
207
209 sal_Int32 getObject() const;
210
212 {
213 return m_nExternalPDFDataIndex >= 0;
214 }
215};
216
218{
221 sal_Int32 m_nObject;
223
225 : m_nObject(0)
226 {
227 }
228};
229
231{
233 std::unique_ptr<SvMemoryStream>
236 sal_Int32 m_nObject;
239
241 : m_nObject(0)
242 , m_bTrueColor(false)
243 {
244 }
245};
246
248{
251 sal_Int32 m_nObject;
252};
253
254// for tilings (drawWallpaper, begin/endPattern)
256{
257 sal_Int32 m_nObject;
262 std::unique_ptr<SvMemoryStream> m_pTilingStream;
263
265 : m_nObject( 0 )
266 {}
267};
268
269// for transparency group XObjects
271{
272 sal_Int32 m_nObject;
274 double m_fAlpha;
276 std::unique_ptr<SvMemoryStream> m_pContentStream;
277
279 : m_nObject( 0 ),
280 m_nExtGStateObject( -1 ),
281 m_fAlpha( 0.0 )
282 {}
283};
284
285// font subsets
286
288{
289 sal_Int32 m_nFontID;
292};
293
295{
296 // performance: actually this should probably a vector;
297 std::vector<sal_Ucs> m_CodeUnits;
299 sal_Int32 m_nGlyphWidth;
300 std::vector<ColorLayer> m_aColorLayers;
304
305public:
307 {
308 }
309
310 void setGlyphId( sal_uInt8 i_nId ) { m_nSubsetGlyphID = i_nId; }
312
313 void setGlyphWidth( sal_Int32 nWidth ) { m_nGlyphWidth = nWidth; }
314 sal_Int32 getGlyphWidth() const { return m_nGlyphWidth; }
315
316 void addColorLayer(ColorLayer aLayer) { m_aColorLayers.push_back(aLayer); }
317 const std::vector<ColorLayer>& getColorLayers() const { return m_aColorLayers; }
318
320 {
322 m_aRect = aRect;
323 }
325 {
326 rRect = m_aRect;
327 return m_aColorBitmap;
328 }
329
330 void setOutline(basegfx::B2DPolyPolygon aOutline) { m_aOutline = aOutline; }
332
333 void addCode( sal_Ucs i_cCode )
334 {
335 m_CodeUnits.push_back(i_cCode);
336 }
337 sal_Int32 countCodes() const { return m_CodeUnits.size(); }
338 const std::vector<sal_Ucs>& codes() const { return m_CodeUnits; }
339 sal_Ucs getCode( sal_Int32 i_nIndex ) const
340 {
341 sal_Ucs nRet = 0;
342 if (o3tl::make_unsigned(i_nIndex) < m_CodeUnits.size())
343 nRet = m_CodeUnits[i_nIndex];
344 return nRet;
345 }
346};
347
349{
350 sal_Int32 m_nFontID;
351 std::map<sal_GlyphId, GlyphEmit> m_aMapping;
352
353 explicit FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {}
354};
355
356struct Glyph
357{
358 sal_Int32 m_nFontID;
360};
361
363{
364 std::vector< FontEmit > m_aSubsets;
365 std::map<sal_GlyphId, Glyph> m_aMapping;
366};
367
369{
372
374 : m_nNormalFontID(0)
375 , m_pFontInstance(nullptr) {}
376};
377
379{
380 sal_Int32 m_nPage;
383};
384
385//--->i56629
387{
388 OUString m_aDestName;
389 sal_Int32 m_nPage;
392};
393
395{
396 sal_Int32 m_nObject;
398 sal_Int32 m_nNextObject;
399 sal_Int32 m_nPrevObject;
400 std::vector< sal_Int32 > m_aChildren;
401 OUString m_aTitle;
402 sal_Int32 m_nDestID;
403
405 : m_nObject( 0 ),
406 m_nParentObject( 0 ),
407 m_nNextObject( 0 ),
408 m_nPrevObject( 0 ),
409 m_nDestID( -1 )
410 {}
411};
412
414{
415 sal_Int32 m_nObject;
417 sal_Int32 m_nPage;
418
420 : m_nObject( -1 ),
421 m_nPage( -1 )
422 {}
423};
424
425struct PDFLink : public PDFAnnotation
426{
427 sal_Int32 m_nDest; // set to -1 for URL, to a dest else
428 OUString m_aURL;
429 sal_Int32 m_nStructParent; // struct parent entry
430 OUString m_AltText;
431
432 PDFLink(OUString const& rAltText)
433 : m_nDest( -1 ),
434 m_nStructParent( -1 )
435 , m_AltText(rAltText)
436 {}
437};
438
441{
443 sal_Int32 m_nObject;
444 OUString m_aSubType;
447 std::unique_ptr<PDFOutputStream> m_pStream;
448
450 : m_nObject(0)
451 {
452 }
453};
454
456{
459};
460
462{
464
466
468 {}
469};
470
473{
475 OUString m_aURL;
481 OUString m_AltText;
483 OUString m_MimeType;
484
485 PDFScreen(OUString const& rAltText, OUString const& rMimeType)
487 , m_AltText(rAltText)
488 , m_nStructParent(-1)
489 , m_MimeType(rMimeType)
490 {
491 }
492};
493
495{
497 OString m_aName;
499 OUString m_aText;
501 OUString m_aValue;
502 OString m_aDAString;
503 OString m_aDRDict;
504 OString m_aMKDict;
505 OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string
506 // since the object number is not known at the moment
507 // of filling m_aMKDict, the string will be encrypted when emitted.
508 // the /CA string MUST BE the last added to m_aMKDict
509 // see code for details
510 sal_Int32 m_nFlags;
511 sal_Int32 m_nParent; // if not 0, parent's object number
512 std::vector<sal_Int32> m_aKids; // widget children, contains object numbers
513 std::vector<sal_Int32> m_aKidsIndex; // widget children, contains index to m_aWidgets
514 OUString m_aOnValue;
515 OUString m_aOffValue;
516 sal_Int32 m_nTabOrder; // lowest number gets first in tab order
517 sal_Int32 m_nRadioGroup;
518 sal_Int32 m_nMaxLen;
527 sal_Int32 m_nDest;
528 std::vector<OUString> m_aListEntries;
529 std::vector<sal_Int32> m_aSelectedEntries;
530 typedef std::unordered_map<OString, SvMemoryStream*> PDFAppearanceStreams;
531 std::unordered_map<OString, PDFAppearanceStreams> m_aAppearances;
532 sal_Int32 m_nStructParent = -1;
533
537 m_nFlags( 0 ),
538 m_nParent( 0 ),
539 m_nTabOrder( 0 ),
540 m_nRadioGroup( -1 ),
541 m_nMaxLen( 0 ),
543 m_nDecimalAccuracy ( 0 ),
545 m_bSubmit( false ),
546 m_bSubmitGet( false ),
547 m_nDest( -1 )
548 {}
549};
550
552{
554 sal_Int32 nValue;
555
558 nValue( 0 )
559 {}
560
562 : eValue( eVal ),
563 nValue( 0 )
564 {}
565
566 explicit PDFStructureAttribute( sal_Int32 nVal )
568 nValue( nVal )
569 {}
570};
571
572struct PDFStructureElementKid // for Kids entries
573{
574 sal_Int32 const nObject; // an object number if nMCID is -1,
575 // else the page object relevant to MCID
576 sal_Int32 const nMCID; // an MCID if >= 0
577
578 explicit PDFStructureElementKid( sal_Int32 nObj ) : nObject( nObj ), nMCID( -1 ) {}
579 PDFStructureElementKid( sal_Int32 MCID, sal_Int32 nPage ) : nObject( nPage ), nMCID( MCID ) {}
580};
581
583{
584 sal_Int32 m_nObject;
586 OString m_aAlias;
587 sal_Int32 m_nOwnElement; // index into structure vector
588 sal_Int32 m_nParentElement; // index into structure vector
591 std::vector< sal_Int32 > m_aChildren; // indexes into structure vector
592 std::list< PDFStructureElementKid > m_aKids;
593 std::map<PDFWriter::StructAttribute, PDFStructureAttribute >
595 ::std::vector<sal_Int32> m_AnnotIds;
598 OUString m_aAltText;
599 css::lang::Locale m_aLocale;
600
601 // m_aContents contains the element's marked content sequence
602 // as pairs of (page nr, MCID)
603
605 : m_nObject( 0 ),
606 m_eType( PDFWriter::NonStructElement ),
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
627 PDFGlyph( const DevicePoint& rPos,
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 /* structure parent tree */
767 std::vector< OString > m_aStructParentTree;
768 /* emit structure marks currently (aka. NonStructElement or not)
769 */
771 /* role map of struct tree root */
772 std::unordered_map< OString, OString >
774 /* structure elements (object ids) that should have ID */
775 std::unordered_set<sal_Int32> m_StructElemObjsWithID;
776
777 /* contains all widgets used in the PDF
778 */
779 std::vector<PDFWidget> m_aWidgets;
780 /* maps radio group id to index of radio group control in m_aWidgets */
781 std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets;
782 /* unordered_map for field names, used to ensure unique field names */
783 std::unordered_map< OString, sal_Int32 > m_aFieldNameMap;
784
785 /* contains Bitmaps for gradient functions until they are written
786 * to the file stream */
787 std::list< GradientEmit > m_aGradients;
788 /* contains bitmap tiling patterns */
789 std::vector< TilingEmit > m_aTilings;
790 std::vector< TransparencyEmit > m_aTransparentObjects;
791 /* contains all font subsets in use */
792 std::map<const vcl::font::PhysicalFontFace*, FontSubset> m_aSubsets;
793 std::map<const vcl::font::PhysicalFontFace*, EmbedFont> m_aSystemFonts;
794 std::map<const vcl::font::PhysicalFontFace*, FontSubset> m_aType3Fonts;
795 sal_Int32 m_nNextFID;
796
799 std::shared_ptr<SvMemoryStream>> m_aPDFBmpCache;
800
801 sal_Int32 m_nCurrentPage;
802
804 // object number of the main signature dictionary
811 std::map< sal_Int32, sal_Int32 > m_aBuildinFontToObjectMap;
812
814 osl::File m_aFile;
816
818
819 /* output redirection; e.g. to accumulate content streams for
820 XObjects
821 */
822 std::list< StreamRedirect > m_aOutputStreams;
823
824 std::list< GraphicsState > m_aGraphicsStack;
826
827 std::unique_ptr<ZCodec> m_pCodec;
828 std::unique_ptr<SvMemoryStream> m_pMemStream;
829
830 std::set< PDFWriter::ErrorCode > m_aErrors;
831
833
835 {
836 sal_uInt64 nPosition{};
837 if (osl::File::E_None != m_aFile.getPos(nPosition))
838 {
839 m_aFile.close();
840 m_bOpen = false;
841 }
842 return nPosition;
843 }
844/*
845variables for PDF security
846i12626
847*/
848/* used to cipher the stream data and for password management */
849 rtlCipher m_aCipher;
850 /* pad string used for password in Standard security handler */
852
853 /* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
854 for 128 bit security */
855 sal_Int32 m_nKeyLength; // key length, 16 or 5
856 sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorithm 3.1
857
858 /* set to true if the following stream must be encrypted, used inside writeBuffer() */
860
861 /* the numerical value of the access permissions, according to PDF spec, must be signed */
863 /* string to hold the PDF creation date */
865 /* string to hold the PDF creation date, for PDF/A metadata */
867 /* the buffer where the data are encrypted, dynamically allocated */
868 std::vector<sal_uInt8> m_vEncryptionBuffer;
869
870 void addRoleMap(OString aAlias, PDFWriter::StructElement eType);
871
872 /* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
873 void checkAndEnableStreamEncryption( sal_Int32 nObject ) override;
874
875 void disableStreamEncryption() override { m_bEncryptThisStream = false; };
876
877 /* */
878 void enableStringEncryption( sal_Int32 nObject );
879
880// test if the encryption is active, if yes than encrypt the unicode string and add to the OStringBuffer parameter
881 void appendUnicodeTextStringEncrypt( const OUString& rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer );
882
883 void appendLiteralStringEncrypt( std::u16string_view rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc = RTL_TEXTENCODING_ASCII_US );
884 void appendLiteralStringEncrypt( std::string_view rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer );
885
886 /* creates fonts and subsets that will be emitted later */
887 void registerGlyph(const sal_GlyphId, const vcl::font::PhysicalFontFace*, const LogicalFontInstance* pFont, const std::vector<sal_Ucs>&, sal_Int32, sal_uInt8&, sal_Int32&);
888 void registerSimpleGlyph(const sal_GlyphId, const vcl::font::PhysicalFontFace*, const std::vector<sal_Ucs>&, sal_Int32, sal_uInt8&, sal_Int32&);
889
890 /* emits a text object according to the passed layout */
891 /* TODO: remove rText as soon as SalLayout will change so that rText is not necessary anymore */
892 void drawVerticalGlyphs( const std::vector<PDFGlyph>& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, const Matrix3& rRotScale, double fAngle, double fXScale, sal_Int32 nFontHeight );
893 void drawHorizontalGlyphs( const std::vector<PDFGlyph>& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, bool bFirst, double fAngle, double fXScale, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight );
894 void drawLayout( SalLayout& rLayout, const OUString& rText, bool bTextLines );
895 void drawRelief( SalLayout& rLayout, const OUString& rText, bool bTextLines );
896 void drawShadow( SalLayout& rLayout, const OUString& rText, bool bTextLines );
897
898 /* writes differences between graphics stack and current real PDF
899 * state to the file
900 */
902
903 /* writes a transparency group object */
905
906 /* writes an XObject of type image, may create
907 a second for the mask
908 */
909 bool writeBitmapObject( const BitmapEmit& rObject, bool bMask = false );
910
911 void writeJPG( const JPGEmit& rEmit );
914
915 /* tries to find the bitmap by its id and returns its emit data if exists,
916 else creates a new emit data block */
917 const BitmapEmit& createBitmapEmit( const BitmapEx& rBitmapEx, const Graphic& rGraphic, std::list<BitmapEmit>& rBitmaps, ResourceDict& rResourceDict, std::list<StreamRedirect>& rOutputStreams );
918 const BitmapEmit& createBitmapEmit( const BitmapEx& rBitmapEx, const Graphic& rGraphic );
919
920 /* writes the Do operation inside the content stream */
921 void drawBitmap( const Point& rDestPt, const Size& rDestSize, const BitmapEmit& rBitmap, const Color& rFillColor );
922 /* write the function object for a Gradient */
923 bool writeGradientFunction( GradientEmit const & rObject );
924 /* creates a GradientEmit and returns its object number */
925 sal_Int32 createGradient( const Gradient& rGradient, const Size& rSize );
926
927 /* writes all tilings */
928 bool emitTilings();
929 /* writes all gradient patterns */
930 bool emitGradients();
931 /* writes a builtin font object and returns its objectid (or 0 in case of failure ) */
932 sal_Int32 emitBuildinFont( const pdf::BuildinFontFace*, sal_Int32 nObject );
933 /* writes a type1 system font object and returns its mapping from font ids to object ids (or 0 in case of failure ) */
934 std::map< sal_Int32, sal_Int32 > emitSystemFont(const vcl::font::PhysicalFontFace*, EmbedFont const &);
935 /* writes a type3 font object and appends it to the font id mapping, or returns false in case of failure */
936 bool emitType3Font(const vcl::font::PhysicalFontFace*, const FontSubset&, std::map<sal_Int32, sal_Int32>&);
937 /* writes a font descriptor and returns its object id (or 0) */
938 sal_Int32 emitFontDescriptor(const vcl::font::PhysicalFontFace*, FontSubsetInfo const &, sal_Int32 nSubsetID, sal_Int32 nStream);
939 /* writes a ToUnicode cmap, returns the corresponding stream object */
940 sal_Int32 createToUnicodeCMap( sal_uInt8 const * pEncoding, const std::vector<sal_Ucs>& CodeUnits, const sal_Int32* pCodeUnitsPerGlyph,
941 const sal_Int32* pEncToUnicodeIndex, uint32_t nGlyphs );
942
943 /* get resource dict object number */
945 {
946 if( m_nResourceDict <= 0 )
948 return m_nResourceDict;
949 }
950 /* get the font dict object */
952 {
953 if( m_nFontDictObject <= 0 )
955 return m_nFontDictObject;
956 }
957 /* push resource into current (redirected) resource dict */
958 static void pushResource( ResourceKind eKind, const OString& rResource, sal_Int32 nObject, ResourceDict& rResourceDict, std::list<StreamRedirect>& rOutputStreams );
959 void pushResource( ResourceKind eKind, const OString& rResource, sal_Int32 nObject );
960
961 void appendBuildinFontsToDict( OStringBuffer& rDict ) const;
962 /* writes the font dictionary and emits all font objects
963 * returns object id of font directory (or 0 on error)
964 */
965 bool emitFonts();
966 /* writes the Resource dictionary;
967 * returns dict object id (or 0 on error)
968 */
969 sal_Int32 emitResources();
970 // appends a dest
971 bool appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer );
972 // write all links
973 bool emitLinkAnnotations();
974 // Write all screen annotations.
976
977 void emitTextAnnotationLine(OStringBuffer & aLine, PDFNoteEntry const & rNote);
978 static void emitPopupAnnotationLine(OStringBuffer & aLine, PDFPopupAnnotation const & rPopUp);
979 // write all notes
980 bool emitNoteAnnotations();
981
982 // write the appearance streams of a widget
983 bool emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDict );
984 // clean up radio button "On" values
986 // write all widgets
988 // writes all annotation objects
989 bool emitAnnotations();
991 bool emitEmbeddedFiles();
992 //write the named destination stuff
993 sal_Int32 emitNamedDestinations();//i56629
994 // writes outline dict and tree
995 sal_Int32 emitOutline();
996 template<typename T> void AppendAnnotKid(PDFStructureElement& i_rEle, T & rAnnot);
997 // puts the attribute objects of a structure element into the returned string,
998 // helper for emitStructure
1000 //--->i94258
1001 // the maximum array elements allowed for PDF array object
1002 static const sal_uInt32 ncMaxPDFArraySize = 8191;
1003 //check if internal dummy container are needed in the structure elements
1005 //<---i94258
1006 // writes document structure
1007 sal_Int32 emitStructure( PDFStructureElement& rEle );
1008 // writes structure parent tree
1009 sal_Int32 emitStructParentTree( sal_Int32 nTreeObject );
1010 // writes structure IDTree
1011 sal_Int32 emitStructIDTree(sal_Int32 nTreeObject);
1012 // writes page tree and catalog
1013 bool emitCatalog();
1014 // writes signature dictionary object
1016 // creates a PKCS7 object using the ByteRange and overwrite /Contents
1017 // of the signature dictionary
1019 // writes xref and trailer
1020 bool emitTrailer();
1021 // emits info dict (if applicable)
1022 sal_Int32 emitInfoDict( );
1023
1024 // acrobat reader 5 and 6 use the order of the annotations
1025 // as their tab order; since PDF1.5 one can make the
1026 // tab order explicit by using the structure tree
1027 void sortWidgets();
1028
1029 // updates the count numbers of outline items
1030 sal_Int32 updateOutlineItemCount( std::vector< sal_Int32 >& rCounts,
1031 sal_Int32 nItemLevel,
1032 sal_Int32 nCurrentItemId );
1033 // default appearances for widgets
1034 sal_Int32 findRadioGroupWidget( const PDFWriter::RadioButtonWidget& rRadio );
1035 Font replaceFont( const Font& rControlFont, const Font& rAppSetFont );
1036 sal_Int32 getBestBuildinFont( const Font& rFont );
1037 sal_Int32 getSystemFont( const Font& i_rFont );
1038
1039 // used for edit and listbox
1041
1047
1048 /* ensure proper escapement and uniqueness of field names */
1049 void createWidgetFieldName( sal_Int32 i_nWidgetsIndex, const PDFWriter::AnyWidget& i_rInWidget );
1051 sal_Int32 createObject() override;
1053 bool updateObject( sal_Int32 n ) override;
1054
1056 bool writeBufferBytes( const void* pBuffer, sal_uInt64 nBytes ) override;
1057 void beginCompression();
1058 void endCompression();
1059 void beginRedirect( SvStream* pStream, const tools::Rectangle& );
1061
1062 void endPage();
1063
1074 bool checkEmitStructure();
1075
1076 /* draws an emphasis mark */
1077 void drawEmphasisMark( tools::Long nX, tools::Long nY, const tools::PolyPolygon& rPolyPoly, bool bPolyLine, const tools::Rectangle& rRect1, const tools::Rectangle& rRect2 );
1078
1079 /* true if PDF/A-1a or PDF/A-1b is output */
1081 /* true if PDF/A-2a is output */
1083
1084 /* PDF/UA support enabled */
1086
1088
1090
1091 /*
1092 i12626
1093 methods for PDF security
1094
1095 pad a password according algorithm 3.2, step 1 */
1096 static void padPassword( std::u16string_view i_rPassword, sal_uInt8* o_pPaddedPW );
1097 /* algorithm 3.2: compute an encryption key */
1100 sal_Int32 i_nAccessPermissions
1101 );
1102 /* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
1103 static bool computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword, const sal_uInt8* i_pPaddedUserPassword,
1104 std::vector< sal_uInt8 >& io_rOValue,
1105 sal_Int32 i_nKeyLength
1106 );
1107 /* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
1108 static bool computeUDictionaryValue( EncHashTransporter* i_pTransporter,
1110 sal_Int32 i_nKeyLength,
1111 sal_Int32 i_nAccessPermissions
1112 );
1113
1114 static void computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
1115 const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
1116 const OString& i_rCString1,
1117 OString& o_rCString2
1118 );
1119 static sal_Int32 computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
1120 sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength );
1121 void setupDocInfo();
1122 bool prepareEncryption( const css::uno::Reference< css::beans::XMaterialHolder >& );
1123
1124 // helper for playMetafile
1125 void implWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient,
1127 void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx, const Graphic& i_pGraphic,
1128 VirtualDevice const * pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
1129
1130 // helpers for CCITT 1bit bitmap stream
1131 void putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState );
1132 void putG4Span( tools::Long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState );
1133 void writeG4Stream( BitmapReadAccess const * i_pBitmap );
1134
1135 // color helper functions
1136 void appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer );
1137 void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer );
1138public:
1139 PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >&, PDFWriter& );
1140 ~PDFWriterImpl() override;
1141 void dispose() override;
1142
1143 static css::uno::Reference< css::beans::XMaterialHolder >
1144 initEncryption( const OUString& i_rOwnerPassword,
1145 const OUString& i_rUserPassword );
1146
1147 /* document structure */
1148 void newPage( double nPageWidth , double nPageHeight, PDFWriter::Orientation eOrientation );
1149 bool emit();
1150 const std::set< PDFWriter::ErrorCode > & getErrors() const { return m_aErrors;}
1151 void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); }
1153
1155 {
1156 Size aSize;
1159 return aSize;
1160 }
1161
1162 void setDocumentLocale( const css::lang::Locale& rLoc )
1163 { m_aContext.DocumentLocale = rLoc; }
1164
1165 /* graphics state */
1166 void push( PushFlags nFlags );
1167 void pop();
1168
1169 void setFont( const Font& rFont );
1170
1171 void setMapMode( const MapMode& rMapMode );
1172
1173 const MapMode& getMapMode() { return m_aGraphicsStack.front().m_aMapMode; }
1174
1175 void setLineColor( const Color& rColor )
1176 {
1177 m_aGraphicsStack.front().m_aLineColor = rColor.IsTransparent() ? COL_TRANSPARENT : rColor;
1178 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::LineColor;
1179 }
1180
1181 void setFillColor( const Color& rColor )
1182 {
1183 m_aGraphicsStack.front().m_aFillColor = rColor.IsTransparent() ? COL_TRANSPARENT : rColor;
1184 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::FillColor;
1185 }
1186
1188 {
1189 m_aGraphicsStack.front().m_aTextLineColor = COL_TRANSPARENT;
1190 }
1191
1192 void setTextLineColor( const Color& rColor )
1193 {
1194 m_aGraphicsStack.front().m_aTextLineColor = rColor;
1195 }
1196
1198 {
1199 m_aGraphicsStack.front().m_aOverlineColor = COL_TRANSPARENT;
1200 }
1201
1202 void setOverlineColor( const Color& rColor )
1203 {
1204 m_aGraphicsStack.front().m_aOverlineColor = rColor;
1205 }
1206
1207 void setTextFillColor( const Color& rColor )
1208 {
1209 m_aGraphicsStack.front().m_aFont.SetFillColor( rColor );
1210 m_aGraphicsStack.front().m_aFont.SetTransparent( rColor.IsTransparent() );
1211 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1212 }
1214 {
1215 m_aGraphicsStack.front().m_aFont.SetFillColor( COL_TRANSPARENT );
1216 m_aGraphicsStack.front().m_aFont.SetTransparent( true );
1217 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1218 }
1219 void setTextColor( const Color& rColor )
1220 {
1221 m_aGraphicsStack.front().m_aFont.SetColor( rColor );
1222 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1223 }
1224
1226 {
1227 m_aGraphicsStack.front().m_aClipRegion.clear();
1228 m_aGraphicsStack.front().m_bClipRegion = false;
1230 }
1231
1232 void setClipRegion( const basegfx::B2DPolyPolygon& rRegion );
1233
1234 void moveClipRegion( sal_Int32 nX, sal_Int32 nY );
1235
1236 void intersectClipRegion( const tools::Rectangle& rRect );
1237
1238 void intersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
1239
1241 {
1242 m_aGraphicsStack.front().m_nLayoutMode = nLayoutMode;
1244 }
1245
1247 {
1248 m_aGraphicsStack.front().m_aDigitLanguage = eLang;
1250 }
1251
1253 {
1254 m_aGraphicsStack.front().m_aFont.SetAlignment( eAlign );
1255 m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsStateUpdateFlags::Font;
1256 }
1257
1258 /* actual drawing functions */
1259 void drawText( const Point& rPos, const OUString& rText, sal_Int32 nIndex, sal_Int32 nLen, bool bTextLines = true );
1260 void drawTextArray( const Point& rPos, const OUString& rText, KernArraySpan pDXArray, o3tl::span<const sal_Bool> pKashidaArray, sal_Int32 nIndex, sal_Int32 nLen );
1261 void drawStretchText( const Point& rPos, sal_Int32 nWidth, const OUString& rText,
1262 sal_Int32 nIndex, sal_Int32 nLen );
1263 void drawText( const tools::Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle );
1264 void drawTextLine( const Point& rPos, tools::Long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline, bool bUnderlineAbove );
1265 void drawWaveTextLine( OStringBuffer& aLine, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
1266 void drawStraightTextLine( OStringBuffer& aLine, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
1267 void drawStrikeoutLine( OStringBuffer& aLine, tools::Long nWidth, FontStrikeout eStrikeout, Color aColor );
1268 void drawStrikeoutChar( const Point& rPos, tools::Long nWidth, FontStrikeout eStrikeout );
1269
1270 void drawLine( const Point& rStart, const Point& rStop );
1271 void drawLine( const Point& rStart, const Point& rStop, const LineInfo& rInfo );
1272 void drawPolygon( const tools::Polygon& rPoly );
1273 void drawPolyPolygon( const tools::PolyPolygon& rPolyPoly );
1274 void drawPolyLine( const tools::Polygon& rPoly );
1275 void drawPolyLine( const tools::Polygon& rPoly, const LineInfo& rInfo );
1276 void drawPolyLine( const tools::Polygon& rPoly, const PDFWriter::ExtLineInfo& rInfo );
1277
1278 void drawPixel( const Point& rPt, const Color& rColor );
1279
1280 void drawRectangle( const tools::Rectangle& rRect );
1281 void drawRectangle( const tools::Rectangle& rRect, sal_uInt32 nHorzRound, sal_uInt32 nVertRound );
1282 void drawEllipse( const tools::Rectangle& rRect );
1283 void drawArc( const tools::Rectangle& rRect, const Point& rStart, const Point& rStop, bool bWithPie, bool bWidthChord );
1284
1285 void drawBitmap( const Point& rDestPoint, const Size& rDestSize, const Bitmap& rBitmap, const Graphic& rGraphic );
1286 void drawBitmap( const Point& rDestPoint, const Size& rDestSize, const BitmapEx& rBitmap );
1287 void drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const Size& rSizePixel, const tools::Rectangle& rTargetArea, const AlphaMask& rAlphaMask, const Graphic& rGraphic );
1289 void createEmbeddedFile(const Graphic& rGraphic, ReferenceXObjectEmit& rEmit, sal_Int32 nBitmapObject);
1290
1291 void drawGradient( const tools::Rectangle& rRect, const Gradient& rGradient );
1292 void drawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch );
1293 void drawWallpaper( const tools::Rectangle& rRect, const Wallpaper& rWall );
1294 void drawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt32 nTransparentPercent );
1296 void endTransparencyGroup( const tools::Rectangle& rBoundingBox, sal_uInt32 nTransparentPercent );
1297
1298 void emitComment( const char* pComment );
1299
1300 //--->i56629 named destinations
1301 sal_Int32 createNamedDest( const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType );
1302
1303 //--->i59651
1304 //emits output intent
1305 sal_Int32 emitOutputIntent();
1306
1307 //emits the document metadata
1308 sal_Int32 emitDocumentMetadata();
1309
1310 // links
1311 sal_Int32 createLink(const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString const& rAltText);
1312 sal_Int32 createDest( const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType );
1313 sal_Int32 registerDestReference( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType );
1314 void setLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
1315 void setLinkURL( sal_Int32 nLinkId, const OUString& rURL );
1316 void setLinkPropertyId( sal_Int32 nLinkId, sal_Int32 nPropertyId );
1317
1318 // screens
1319 sal_Int32 createScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString const& rAltText, OUString const& rMimeType);
1320 void setScreenURL(sal_Int32 nScreenId, const OUString& rURL);
1321 void setScreenStream(sal_Int32 nScreenId, const OUString& rURL);
1322
1323 // outline
1324 sal_Int32 createOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID );
1325 void setOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
1326 void setOutlineItemText( sal_Int32 nItem, std::u16string_view rText );
1327 void setOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
1328
1329 // notes
1330 void createNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr );
1331 // structure elements
1332 sal_Int32 beginStructureElement( PDFWriter::StructElement eType, std::u16string_view rAlias );
1333 void endStructureElement();
1334 bool setCurrentStructureElement( sal_Int32 nElement );
1336 bool setStructureAttributeNumerical( enum PDFWriter::StructAttribute eAttr, sal_Int32 nValue );
1337 void setStructureBoundingBox( const tools::Rectangle& rRect );
1338 void setStructureAnnotIds(::std::vector<sal_Int32> const& rAnnotIds);
1339 void setActualText( const OUString& rText );
1340 void setAlternateText( const OUString& rText );
1341
1342 // transitional effects
1343 void setPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1344
1345 // controls
1346 sal_Int32 createControl( const PDFWriter::AnyWidget& rControl, sal_Int32 nPageNr = -1 );
1347
1348 // attached file
1349 void addDocumentAttachedFile(OUString const& rFileName, OUString const& rMimeType, OUString const& rDescription, std::unique_ptr<PDFOutputStream> rStream);
1350
1351 sal_Int32 addEmbeddedFile(BinaryDataContainer const & rDataContainer);
1352 sal_Int32 addEmbeddedFile(std::unique_ptr<PDFOutputStream> rStream, OUString const& rMimeType);
1353
1354 // helper: eventually begin marked content sequence and
1355 // emit a comment in debug case
1356 void MARK( const char* pString );
1357};
1358
1359} // namespace vcl
1360
1361/* 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)
sal_Int32 beginStructureElement(PDFWriter::StructElement eType, std::u16string_view rAlias)
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 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 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
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)
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:632
Play a metafile like an outputdevice would do.
Definition: pdfwriter.hxx:697
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.
PDFGlyph(const DevicePoint &rPos, const GlyphItem *pGlyph, const LogicalFontInstance *pFont, sal_Int32 nNativeWidth, sal_Int32 nFontId, sal_uInt8 nMappedGlyphId, int nCharPos)
sal_uInt8 const m_nMappedGlyphId
sal_Int32 const m_nMappedFontId
const LogicalFontInstance * m_pFont
sal_Int32 const m_nNativeWidth
DevicePoint const m_aPos
const GlyphItem * m_pGlyph
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
PDFWriter::StructElement m_eType
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