diff options
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.hxx')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 480 |
1 files changed, 240 insertions, 240 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 95b8419a8131..ce72411fbe08 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -86,19 +86,19 @@ public: // definition of structs struct BuiltinFont { - const char * m_pName; // Name - const char * m_pStyleName; // StyleName - const char * m_pPSName; // PSName - int m_nAscent; - int m_nDescent; - FontFamily m_eFamily; // Family - CharSet m_eCharSet; // CharSet - FontPitch m_ePitch; // Pitch - FontWidth m_eWidthType; // WidthType - FontWeight m_eWeight; // Weight - FontItalic m_eItalic; // Italic - int m_aWidths[256]; // character metrics - + const char * m_pName; // Name + const char * m_pStyleName; // StyleName + const char * m_pPSName; // PSName + int m_nAscent; + int m_nDescent; + FontFamily m_eFamily; // Family + CharSet m_eCharSet; // CharSet + FontPitch m_ePitch; // Pitch + FontWidth m_eWidthType; // WidthType + FontWeight m_eWeight; // Weight + FontItalic m_eItalic; // Italic + int m_aWidths[256]; // character metrics + rtl::OString getNameObject() const; }; @@ -112,26 +112,26 @@ public: ResourceMap m_aExtGStates; ResourceMap m_aShadings; ResourceMap m_aPatterns; - + void append( rtl::OStringBuffer&, sal_Int32 nFontDictObject ); }; - + struct PDFPage { - PDFWriterImpl* m_pWriter; - sal_Int32 m_nPageWidth; // in inch/72 - sal_Int32 m_nPageHeight; // in inch/72 - PDFWriter::Orientation m_eOrientation; - sal_Int32 m_nPageObject; - sal_Int32 m_nPageIndex; - std::vector<sal_Int32> m_aStreamObjects; - sal_Int32 m_nStreamLengthObject; - sal_uInt64 m_nBeginStreamPos; - std::vector<sal_Int32> m_aAnnotations; - std::vector<sal_Int32> m_aMCIDParents; - PDFWriter::PageTransition m_eTransition; - sal_uInt32 m_nTransTime; - sal_uInt32 m_nDuration; + PDFWriterImpl* m_pWriter; + sal_Int32 m_nPageWidth; // in inch/72 + sal_Int32 m_nPageHeight; // in inch/72 + PDFWriter::Orientation m_eOrientation; + sal_Int32 m_nPageObject; + sal_Int32 m_nPageIndex; + std::vector<sal_Int32> m_aStreamObjects; + sal_Int32 m_nStreamLengthObject; + sal_uInt64 m_nBeginStreamPos; + std::vector<sal_Int32> m_aAnnotations; + std::vector<sal_Int32> m_aMCIDParents; + PDFWriter::PageTransition m_eTransition; + sal_uInt32 m_nTransTime; + sal_uInt32 m_nDuration; bool m_bHasWidgets; PDFPage( PDFWriterImpl* pWriter, sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation ); @@ -166,7 +166,7 @@ public: // can be important if the source MapMode is not // symmetrical) to page length and appends it to the buffer // if pOutLength is set it will be updated to the emitted length - // (in PDF map mode, that is 10th of point) + // (in PDF map mode, that is 10th of point) void appendMappedLength( sal_Int32 nLength, rtl::OStringBuffer& rBuffer, bool bVertical = true, sal_Int32* pOutLength = NULL ) const; // the same for double values void appendMappedLength( double fLength, rtl::OStringBuffer& rBuffer, bool bVertical = true, sal_Int32* pOutLength = NULL, sal_Int32 nPrecision = 5 ) const; @@ -185,19 +185,19 @@ public: struct BitmapID { - Size m_aPixelSize; - sal_Int32 m_nSize; - sal_Int32 m_nChecksum; - sal_Int32 m_nMaskChecksum; - + Size m_aPixelSize; + sal_Int32 m_nSize; + sal_Int32 m_nChecksum; + sal_Int32 m_nMaskChecksum; + BitmapID() : m_nSize( 0 ), m_nChecksum( 0 ), m_nMaskChecksum( 0 ) {} BitmapID& operator=( const BitmapID& rCopy ) { - m_aPixelSize = rCopy.m_aPixelSize; - m_nSize = rCopy.m_nSize; - m_nChecksum = rCopy.m_nChecksum; - m_nMaskChecksum = rCopy.m_nMaskChecksum; + m_aPixelSize = rCopy.m_aPixelSize; + m_nSize = rCopy.m_nSize; + m_nChecksum = rCopy.m_nChecksum; + m_nMaskChecksum = rCopy.m_nMaskChecksum; return *this; } @@ -212,20 +212,20 @@ public: struct BitmapEmit { - BitmapID m_aID; - BitmapEx m_aBitmap; - sal_Int32 m_nObject; - bool m_bDrawMask; + BitmapID m_aID; + BitmapEx m_aBitmap; + sal_Int32 m_nObject; + bool m_bDrawMask; BitmapEmit() : m_bDrawMask( false ) {} }; struct JPGEmit { - BitmapID m_aID; - SvMemoryStream* m_pStream; - Bitmap m_aMask; - sal_Int32 m_nObject; + BitmapID m_aID; + SvMemoryStream* m_pStream; + Bitmap m_aMask; + sal_Int32 m_nObject; bool m_bTrueColor; JPGEmit() : m_pStream( NULL ) {} @@ -234,9 +234,9 @@ public: struct GradientEmit { - Gradient m_aGradient; - Size m_aSize; - sal_Int32 m_nObject; + Gradient m_aGradient; + Size m_aSize; + sal_Int32 m_nObject; }; // for tilings (drawWallpaper, begin/endPattern) @@ -248,7 +248,7 @@ public: SvtGraphicFill::Transform m_aTransform; ResourceDict m_aResources; SvMemoryStream* m_pTilingStream; - + TilingEmit() : m_nObject( 0 ), m_pTilingStream( NULL ) @@ -258,12 +258,12 @@ public: // for transparency group XObjects struct TransparencyEmit { - sal_Int32 m_nObject; - sal_Int32 m_nExtGStateObject; - double m_fAlpha; - Rectangle m_aBoundRect; - SvMemoryStream* m_pContentStream; - SvMemoryStream* m_pSoftMaskStream; + sal_Int32 m_nObject; + sal_Int32 m_nExtGStateObject; + double m_fAlpha; + Rectangle m_aBoundRect; + SvMemoryStream* m_pContentStream; + SvMemoryStream* m_pSoftMaskStream; TransparencyEmit() : m_nObject( 0 ), @@ -283,12 +283,12 @@ public: class GlyphEmit { // performance: actually this should probably a vector; - sal_Ucs m_aBufferedUnicodes[3]; + sal_Ucs m_aBufferedUnicodes[3]; sal_Int32 m_nUnicodes; sal_Int32 m_nMaxUnicodes; boost::shared_array<sal_Ucs> m_pUnicodes; sal_uInt8 m_nSubsetGlyphID; - + public: GlyphEmit() : m_nUnicodes(0), m_nSubsetGlyphID(0) { @@ -301,7 +301,7 @@ public: void setGlyphId( sal_uInt8 i_nId ) { m_nSubsetGlyphID = i_nId; } sal_uInt8 getGlyphId() const { return m_nSubsetGlyphID; } - + void addCode( sal_Ucs i_cCode ) { if( m_nUnicodes == m_nMaxUnicodes ) @@ -331,73 +331,73 @@ public: typedef std::map< sal_GlyphId, GlyphEmit > FontEmitMapping; struct FontEmit { - sal_Int32 m_nFontID; - FontEmitMapping m_aMapping; + sal_Int32 m_nFontID; + FontEmitMapping m_aMapping; FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {} }; typedef std::list< FontEmit > FontEmitList; struct Glyph { - sal_Int32 m_nFontID; - sal_uInt8 m_nSubsetGlyphID; + sal_Int32 m_nFontID; + sal_uInt8 m_nSubsetGlyphID; }; typedef std::map< sal_GlyphId, Glyph > FontMapping; struct FontSubset { - FontEmitList m_aSubsets; - FontMapping m_aMapping; + FontEmitList m_aSubsets; + FontMapping m_aMapping; }; typedef std::map< const ImplFontData*, FontSubset > FontSubsetData; struct EmbedCode { - sal_Ucs m_aUnicode; - rtl::OString m_aName; + sal_Ucs m_aUnicode; + rtl::OString m_aName; }; struct EmbedEncoding { - sal_Int32 m_nFontID; - std::vector< EmbedCode > m_aEncVector; - std::map< sal_Ucs, sal_Int8 > m_aCMap; + sal_Int32 m_nFontID; + std::vector< EmbedCode > m_aEncVector; + std::map< sal_Ucs, sal_Int8 > m_aCMap; }; struct EmbedFont { - sal_Int32 m_nNormalFontID; - std::list< EmbedEncoding > m_aExtendedEncodings; - + sal_Int32 m_nNormalFontID; + std::list< EmbedEncoding > m_aExtendedEncodings; + EmbedFont() : m_nNormalFontID( 0 ) {} }; typedef std::map< const ImplFontData*, EmbedFont > FontEmbedData; struct PDFDest { - sal_Int32 m_nPage; - PDFWriter::DestAreaType m_eType; - Rectangle m_aRect; + sal_Int32 m_nPage; + PDFWriter::DestAreaType m_eType; + Rectangle m_aRect; }; //--->i56629 struct PDFNamedDest { rtl::OUString m_aDestName; - sal_Int32 m_nPage; - PDFWriter::DestAreaType m_eType; - Rectangle m_aRect; + sal_Int32 m_nPage; + PDFWriter::DestAreaType m_eType; + Rectangle m_aRect; }; //<--- - + struct PDFOutlineEntry { - sal_Int32 m_nParentID; - sal_Int32 m_nObject; - sal_Int32 m_nParentObject; - sal_Int32 m_nNextObject; - sal_Int32 m_nPrevObject; - std::vector< sal_Int32 > m_aChildren; - rtl::OUString m_aTitle; - sal_Int32 m_nDestID; - - PDFOutlineEntry() + sal_Int32 m_nParentID; + sal_Int32 m_nObject; + sal_Int32 m_nParentObject; + sal_Int32 m_nNextObject; + sal_Int32 m_nPrevObject; + std::vector< sal_Int32 > m_aChildren; + rtl::OUString m_aTitle; + sal_Int32 m_nDestID; + + PDFOutlineEntry() : m_nParentID( -1 ), m_nObject( 0 ), m_nParentObject( 0 ), @@ -409,9 +409,9 @@ public: struct PDFAnnotation { - sal_Int32 m_nObject; - Rectangle m_aRect; - sal_Int32 m_nPage; + sal_Int32 m_nObject; + Rectangle m_aRect; + sal_Int32 m_nPage; PDFAnnotation() : m_nObject( -1 ), @@ -421,11 +421,11 @@ public: struct PDFLink : public PDFAnnotation { - sal_Int32 m_nDest; // set to -1 for URL, to a dest else - rtl::OUString m_aURL; + sal_Int32 m_nDest; // set to -1 for URL, to a dest else + rtl::OUString m_aURL; sal_Int32 m_nStructParent; // struct parent entry - - PDFLink() + + PDFLink() : m_nDest( -1 ), m_nStructParent( -1 ) {} @@ -433,7 +433,7 @@ public: struct PDFNoteEntry : public PDFAnnotation { - PDFNote m_aContents; + PDFNote m_aContents; PDFNoteEntry() {} @@ -444,34 +444,34 @@ public: struct PDFWidget : public PDFAnnotation { - PDFWriter::WidgetType m_eType; - rtl::OString m_aName; - rtl::OUString m_aDescription; - rtl::OUString m_aText; - USHORT m_nTextStyle; - rtl::OUString m_aValue; + PDFWriter::WidgetType m_eType; + rtl::OString m_aName; + rtl::OUString m_aDescription; + rtl::OUString m_aText; + USHORT m_nTextStyle; + rtl::OUString m_aValue; rtl::OString m_aDAString; rtl::OString m_aDRDict; - rtl::OString m_aMKDict; - rtl::OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string + rtl::OString m_aMKDict; + rtl::OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string // since the object number is not known at the moment // of filling m_aMKDict, the string will be encrypted when emitted. // the /CA string MUST BE the last added to m_aMKDict // see code for details - sal_Int32 m_nFlags; - sal_Int32 m_nParent; // if not 0, parent's object number - std::vector<sal_Int32> m_aKids; // widget children, contains object numbers + sal_Int32 m_nFlags; + sal_Int32 m_nParent; // if not 0, parent's object number + std::vector<sal_Int32> m_aKids; // widget children, contains object numbers std::vector<sal_Int32> m_aKidsIndex; // widget children, contains index to m_aWidgets rtl::OUString m_aOnValue; sal_Int32 m_nTabOrder; // lowest number gets first in tab order - sal_Int32 m_nRadioGroup; - sal_Int32 m_nMaxLen; + sal_Int32 m_nRadioGroup; + sal_Int32 m_nMaxLen; bool m_bSubmit; bool m_bSubmitGet; sal_Int32 m_nDest; - std::vector<rtl::OUString> m_aListEntries; + std::vector<rtl::OUString> m_aListEntries; std::vector<sal_Int32> m_aSelectedEntries; - PDFAppearanceMap m_aAppearances; + PDFAppearanceMap m_aAppearances; PDFWidget() : m_eType( PDFWriter::PushButton ), m_nTextStyle( 0 ), @@ -484,11 +484,11 @@ public: m_nDest( -1 ) {} }; - + struct PDFStructureAttribute { - PDFWriter::StructAttributeValue eValue; - sal_Int32 nValue; + PDFWriter::StructAttributeValue eValue; + sal_Int32 nValue; PDFStructureAttribute() : eValue( PDFWriter::Invalid ), @@ -513,26 +513,26 @@ public: sal_Int32 nObject; // an object number if nMCID is -1, // else the page object relevant to MCID sal_Int32 nMCID; // an MCID if >= 0 - + PDFStructureElementKid( sal_Int32 nObj ) : nObject( nObj ), nMCID( -1 ) {} PDFStructureElementKid( sal_Int32 MCID, sal_Int32 nPage ) : nObject( nPage ), nMCID( MCID ) {} }; - + struct PDFStructureElement { - sal_Int32 m_nObject; - PDFWriter::StructElement m_eType; + sal_Int32 m_nObject; + PDFWriter::StructElement m_eType; rtl::OString m_aAlias; - sal_Int32 m_nOwnElement; // index into structure vector - sal_Int32 m_nParentElement; // index into structure vector - sal_Int32 m_nFirstPageObject; - bool m_bOpenMCSeq; - std::list< sal_Int32 > m_aChildren; // indexes into structure vector + sal_Int32 m_nOwnElement; // index into structure vector + sal_Int32 m_nParentElement; // index into structure vector + sal_Int32 m_nFirstPageObject; + bool m_bOpenMCSeq; + std::list< sal_Int32 > m_aChildren; // indexes into structure vector std::list< PDFStructureElementKid > m_aKids; - PDFStructAttributes m_aAttributes; - Rectangle m_aBBox; - rtl::OUString m_aActualText; - rtl::OUString m_aAltText; + PDFStructAttributes m_aAttributes; + Rectangle m_aBBox; + rtl::OUString m_aActualText; + rtl::OUString m_aAltText; com::sun::star::lang::Locale m_aLocale; // m_aContents contains the element's marked content sequence @@ -549,18 +549,18 @@ public: } }; - + struct PDFAddStream { rtl::OUString m_aMimeType; PDFOutputStream* m_pStream; sal_Int32 m_nStreamObject; bool m_bCompress; - + PDFAddStream() : m_pStream( NULL ), m_nStreamObject( 0 ), m_bCompress( true ) {} }; - - + + // helper structure for drawLayout and friends struct PDFGlyph { @@ -569,7 +569,7 @@ public: sal_Int32 m_nGlyphId; sal_Int32 m_nMappedFontId; sal_uInt8 m_nMappedGlyphId; - + PDFGlyph( const Point& rPos, sal_Int32 nNativeWidth, sal_Int32 nGlyphId, @@ -584,7 +584,7 @@ public: static const sal_Char* getStructureTag( PDFWriter::StructElement ); static const sal_Char* getAttributeTag( PDFWriter::StructAttribute eAtr ); static const sal_Char* getAttributeValueTag( PDFWriter::StructAttributeValue eVal ); - + // returns true if compression was done // else false static bool compressStream( SvMemoryStream* ); @@ -593,99 +593,99 @@ public: private: static const BuiltinFont m_aBuiltinFonts[14]; - OutputDevice* m_pReferenceDevice; + OutputDevice* m_pReferenceDevice; - MapMode m_aMapMode; // PDFWriterImpl scaled units - std::vector< PDFPage > m_aPages; - PDFDocInfo m_aDocInfo; + MapMode m_aMapMode; // PDFWriterImpl scaled units + std::vector< PDFPage > m_aPages; + PDFDocInfo m_aDocInfo; /* maps object numbers to file offsets (needed for xref) */ - std::vector< sal_uInt64 > m_aObjects; + std::vector< sal_uInt64 > m_aObjects; /* contains Bitmaps until they are written to the * file stream as XObjects*/ - std::list< BitmapEmit > m_aBitmaps; + std::list< BitmapEmit > m_aBitmaps; /* contains JPG streams until written to file */ - std::list<JPGEmit> m_aJPGs; + std::list<JPGEmit> m_aJPGs; /*--->i56629 contains all named destinations ever set during the PDF creation, destination id is always the destination's position in this vector */ - std::vector<PDFNamedDest> m_aNamedDests; + std::vector<PDFNamedDest> m_aNamedDests; //<--- /* contains all dests ever set during the PDF creation, dest id is always the dest's position in this vector */ - std::vector<PDFDest> m_aDests; + std::vector<PDFDest> m_aDests; /* contains all links ever set during PDF creation, link id is always the link's position in this vector */ - std::vector<PDFLink> m_aLinks; + std::vector<PDFLink> m_aLinks; /* makes correctly encoded for export to PDF URLS */ com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > m_xTrans; /* maps arbitrary link ids for structure attributes to real link ids (for setLinkPropertyId) */ - std::map<sal_Int32, sal_Int32> m_aLinkPropertyMap; + std::map<sal_Int32, sal_Int32> m_aLinkPropertyMap; /* contains all outline items, object 0 is the outline root */ - std::vector<PDFOutlineEntry> m_aOutline; + std::vector<PDFOutlineEntry> m_aOutline; /* contains all notes set during PDF creation */ - std::vector<PDFNoteEntry> m_aNotes; + std::vector<PDFNoteEntry> m_aNotes; /* the root of the structure tree */ - std::vector<PDFStructureElement> m_aStructure; + std::vector<PDFStructureElement> m_aStructure; /* current object in the structure hierarchy */ - sal_Int32 m_nCurrentStructElement; + sal_Int32 m_nCurrentStructElement; /* structure parent tree */ std::vector< rtl::OString > m_aStructParentTree; /* emit strucure marks currently (aka. NonStructElement or not) */ - bool m_bEmitStructure; - bool m_bNewMCID; + bool m_bEmitStructure; + bool m_bNewMCID; /* role map of struct tree root */ std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aRoleMap; /* contains all widgets used in the PDF */ - std::vector<PDFWidget> m_aWidgets; + std::vector<PDFWidget> m_aWidgets; /* maps radio group id to index of radio group control in m_aWidgets */ - std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets; + std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets; /* used to store control id during beginControlAppearance/endControlAppearance */ - sal_Int32 m_nCurrentControl; + sal_Int32 m_nCurrentControl; /* hash_map for field names, used to ensure unique field names */ std::hash_map< rtl::OString, sal_Int32, rtl::OStringHash > m_aFieldNameMap; /* contains Bitmaps for gradient functions until they are written * to the file stream */ - std::list< GradientEmit > m_aGradients; + std::list< GradientEmit > m_aGradients; /* contains bitmap tiling patterns */ - std::vector< TilingEmit > m_aTilings; - std::list< TransparencyEmit > m_aTransparentObjects; + std::vector< TilingEmit > m_aTilings; + std::list< TransparencyEmit > m_aTransparentObjects; /* contains all font subsets in use */ - FontSubsetData m_aSubsets; + FontSubsetData m_aSubsets; bool m_bEmbedStandardFonts; - FontEmbedData m_aEmbeddedFonts; + FontEmbedData m_aEmbeddedFonts; FontEmbedData m_aSystemFonts; - sal_Int32 m_nNextFID; + sal_Int32 m_nNextFID; PDFFontCache m_aFontCache; - sal_Int32 m_nInheritedPageWidth; // in inch/72 - sal_Int32 m_nInheritedPageHeight; // in inch/72 - PDFWriter::Orientation m_eInheritedOrientation; - sal_Int32 m_nCurrentPage; + sal_Int32 m_nInheritedPageWidth; // in inch/72 + sal_Int32 m_nInheritedPageHeight; // in inch/72 + PDFWriter::Orientation m_eInheritedOrientation; + sal_Int32 m_nCurrentPage; - sal_Int32 m_nCatalogObject; - sal_Int32 m_nResourceDict; + sal_Int32 m_nCatalogObject; + sal_Int32 m_nResourceDict; ResourceDict m_aGlobalResourceDict; sal_Int32 m_nFontDictObject; std::map< sal_Int32, sal_Int32 > m_aBuiltinFontToObjectMap; - PDFWriter::PDFWriterContext m_aContext; - oslFileHandle m_aFile; - bool m_bOpen; + PDFWriter::PDFWriterContext m_aContext; + oslFileHandle m_aFile; + bool m_bOpen; /* output redirection; e.g. to accumulate content streams for @@ -693,31 +693,31 @@ private: */ struct StreamRedirect { - SvStream* m_pStream; - MapMode m_aMapMode; + SvStream* m_pStream; + MapMode m_aMapMode; Rectangle m_aTargetRect; ResourceDict m_aResourceDict; }; - std::list< StreamRedirect > m_aOutputStreams; + std::list< StreamRedirect > m_aOutputStreams; // graphics state struct GraphicsState { - Font m_aFont; - MapMode m_aMapMode; - Color m_aLineColor; - Color m_aFillColor; - Color m_aTextLineColor; - Color m_aOverlineColor; - basegfx::B2DPolyPolygon m_aClipRegion; + Font m_aFont; + MapMode m_aMapMode; + Color m_aLineColor; + Color m_aFillColor; + Color m_aTextLineColor; + Color m_aOverlineColor; + basegfx::B2DPolyPolygon m_aClipRegion; bool m_bClipRegion; - sal_Int32 m_nAntiAlias; - sal_Int32 m_nLayoutMode; + sal_Int32 m_nAntiAlias; + sal_Int32 m_nLayoutMode; LanguageType m_aDigitLanguage; - sal_Int32 m_nTransparentPercent; - sal_uInt16 m_nFlags; + sal_Int32 m_nTransparentPercent; + sal_uInt16 m_nFlags; sal_uInt16 m_nUpdateFlags; - + static const sal_uInt16 updateFont = 0x0001; static const sal_uInt16 updateMapMode = 0x0002; static const sal_uInt16 updateLineColor = 0x0004; @@ -763,80 +763,80 @@ private: GraphicsState& operator=(const GraphicsState& rState ) { - m_aFont = rState.m_aFont; - m_aMapMode = rState.m_aMapMode; - m_aLineColor = rState.m_aLineColor; - m_aFillColor = rState.m_aFillColor; - m_aTextLineColor = rState.m_aTextLineColor; - m_aOverlineColor = rState.m_aOverlineColor; - m_aClipRegion = rState.m_aClipRegion; + m_aFont = rState.m_aFont; + m_aMapMode = rState.m_aMapMode; + m_aLineColor = rState.m_aLineColor; + m_aFillColor = rState.m_aFillColor; + m_aTextLineColor = rState.m_aTextLineColor; + m_aOverlineColor = rState.m_aOverlineColor; + m_aClipRegion = rState.m_aClipRegion; m_bClipRegion = rState.m_bClipRegion; - m_nAntiAlias = rState.m_nAntiAlias; - m_nLayoutMode = rState.m_nLayoutMode; + m_nAntiAlias = rState.m_nAntiAlias; + m_nLayoutMode = rState.m_nLayoutMode; m_aDigitLanguage = rState.m_aDigitLanguage; - m_nTransparentPercent = rState.m_nTransparentPercent; - m_nFlags = rState.m_nFlags; + m_nTransparentPercent = rState.m_nTransparentPercent; + m_nFlags = rState.m_nFlags; m_nUpdateFlags = rState.m_nUpdateFlags; return *this; } }; - std::list< GraphicsState > m_aGraphicsStack; - GraphicsState m_aCurrentPDFState; - - ZCodec* m_pCodec; - SvMemoryStream* m_pMemStream; + std::list< GraphicsState > m_aGraphicsStack; + GraphicsState m_aCurrentPDFState; + ZCodec* m_pCodec; + SvMemoryStream* m_pMemStream; + std::vector< PDFAddStream > m_aAdditionalStreams; std::set< PDFWriter::ErrorCode > m_aErrors; - + rtlDigest m_aDocDigest; /* variables for PDF security -i12626 +i12626 */ /* used to cipher the stream data and for password management */ - rtlCipher m_aCipher; - rtlDigest m_aDigest; + rtlCipher m_aCipher; + rtlDigest m_aDigest; /* pad string used for password in Standard security handler */ - sal_uInt8 m_nPadString[ENCRYPTED_PWD_SIZE]; + sal_uInt8 m_nPadString[ENCRYPTED_PWD_SIZE]; /* the owner password, in clear text */ - rtl::OUString m_aOwnerPassword; + rtl::OUString m_aOwnerPassword; /* the padded owner password */ - sal_uInt8 m_nPaddedOwnerPassword[ENCRYPTED_PWD_SIZE]; + sal_uInt8 m_nPaddedOwnerPassword[ENCRYPTED_PWD_SIZE]; /* the encryption dictionary owner password, according to algorithm 3.3 */ - sal_uInt8 m_nEncryptedOwnerPassword[ENCRYPTED_PWD_SIZE]; + sal_uInt8 m_nEncryptedOwnerPassword[ENCRYPTED_PWD_SIZE]; /* the user password, in clear text */ - rtl::OUString m_aUserPassword; + rtl::OUString m_aUserPassword; /* the padded user password */ - sal_uInt8 m_nPaddedUserPassword[ENCRYPTED_PWD_SIZE]; + sal_uInt8 m_nPaddedUserPassword[ENCRYPTED_PWD_SIZE]; /* the encryption dictionary user password, according to algorithm 3.4 or 3.5 depending on the security handler revision */ - sal_uInt8 m_nEncryptedUserPassword[ENCRYPTED_PWD_SIZE]; + sal_uInt8 m_nEncryptedUserPassword[ENCRYPTED_PWD_SIZE]; /* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2 for 128 bit security */ - sal_uInt8 m_nEncryptionKey[MAXIMUM_RC4_KEY_LENGTH]; - sal_Int32 m_nKeyLength; // key length, 16 or 5 - sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorith 3.1 + sal_uInt8 m_nEncryptionKey[MAXIMUM_RC4_KEY_LENGTH]; + sal_Int32 m_nKeyLength; // key length, 16 or 5 + sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorith 3.1 /* set to true if the following stream must be encrypted, used inside writeBuffer() */ - sal_Bool m_bEncryptThisStream; + sal_Bool m_bEncryptThisStream; /* the numerical value of the access permissions, according to PDF spec, must be signed */ sal_Int32 m_nAccessPermissions; /* the document ID, the raw MD5 hash */ - sal_uInt8 m_nDocID[MD5_DIGEST_SIZE]; + sal_uInt8 m_nDocID[MD5_DIGEST_SIZE]; /* string buffer to hold document ID, this is the output string */ - rtl::OStringBuffer m_aDocID; + rtl::OStringBuffer m_aDocID; /* string to hold the PDF creation date */ - rtl::OStringBuffer m_aCreationDateString; + rtl::OStringBuffer m_aCreationDateString; /* string to hold the PDF creation date, for PDF/A metadata */ - rtl::OStringBuffer m_aCreationMetaDateString; + rtl::OStringBuffer m_aCreationMetaDateString; /* the buffer where the data are encrypted, dynamically allocated */ - sal_uInt8 *m_pEncryptionBuffer; + sal_uInt8 *m_pEncryptionBuffer; /* size of the buffer */ - sal_Int32 m_nEncryptionBufferSize; + sal_Int32 m_nEncryptionBufferSize; /* check and reallocate the buffer for encryption */ sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize ) @@ -883,7 +883,7 @@ i12626 // do the MD5 hash sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ]; // the i+2 to take into account the generation number, always zero - rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) ); + rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) ); // initialize the RC4 with the key // key legth: see algoritm 3.1, step 4: (N+5) max 16 rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 ); @@ -903,7 +903,7 @@ i12626 // do the MD5 hash sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ]; // the i+2 to take into account the generation number, always zero - rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) ); + rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) ); // initialize the RC4 with the key // key legth: see algoritm 3.1, step 4: (N+5) max 16 rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 ); @@ -1035,7 +1035,7 @@ i12626 bool emitAdditionalStreams(); // emits info dict (if applicable) sal_Int32 emitInfoDict( ); - + // acrobat reader 5 and 6 use the order of the annotations // as their tab order; since PDF1.5 one can make the // tab order explicit by using the structure tree @@ -1050,10 +1050,10 @@ i12626 Font replaceFont( const Font& rControlFont, const Font& rAppSetFont ); sal_Int32 getBestBuiltinFont( const Font& rFont ); sal_Int32 getSystemFont( const Font& i_rFont ); - + // used for edit and listbox Font drawFieldBorder( PDFWidget&, const PDFWriter::AnyWidget&, const StyleSettings& ); - + void createDefaultPushButtonAppearance( PDFWidget&, const PDFWriter::PushButtonWidget& rWidget ); void createDefaultCheckBoxAppearance( PDFWidget&, const PDFWriter::CheckBoxWidget& rWidget ); void createDefaultRadioButtonAppearance( PDFWidget&, const PDFWriter::RadioButtonWidget& rWidget ); @@ -1069,7 +1069,7 @@ i12626 /* sets the offset of object n to the current position of output file+1 */ bool updateObject( sal_Int32 n ); - + bool writeBuffer( const void* pBuffer, sal_uInt64 nBytes ); void beginCompression(); void endCompression(); @@ -1115,9 +1115,9 @@ public: PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext ); ~PDFWriterImpl(); - /* for OutputDevice so the reference device can have a list - * that contains only suitable fonts (subsettable or builtin) - * produces a new font list + /* for OutputDevice so the reference device can have a list + * that contains only suitable fonts (subsettable or builtin) + * produces a new font list */ ImplDevFontList* filterDevFontList( ImplDevFontList* pFontList ); /* for OutputDevice: get layout for builtin fonts @@ -1136,7 +1136,7 @@ public: bool emit(); std::set< PDFWriter::ErrorCode > getErrors(); void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); } - + Size getCurPageSize() const { Size aSize; @@ -1148,7 +1148,7 @@ public: PDFWriter::PDFVersion getVersion() const { return m_aContext.Version; } void setDocInfo( const PDFDocInfo& rInfo ); const PDFDocInfo& getDocInfo() const { return m_aDocInfo; } - + void setDocumentLocale( const com::sun::star::lang::Locale& rLoc ) { m_aContext.DocumentLocale = rLoc; } @@ -1174,19 +1174,19 @@ public: void setFillColor( const Color& rColor ) { m_aGraphicsStack.front().m_aFillColor = ImplIsColorTransparent(rColor) ? Color( COL_TRANSPARENT ) : rColor; - m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFillColor; + m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFillColor; } void setTextLineColor() { m_aGraphicsStack.front().m_aTextLineColor = Color( COL_TRANSPARENT ); - m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor; + m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor; } void setTextLineColor( const Color& rColor ) { m_aGraphicsStack.front().m_aTextLineColor = rColor; - m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor; + m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor; } void setOverlineColor() @@ -1239,7 +1239,7 @@ public: m_aGraphicsStack.front().m_nLayoutMode = nLayoutMode; m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateLayoutMode; } - + void setDigitLanguage( LanguageType eLang ) { m_aGraphicsStack.front().m_aDigitLanguage = eLang; @@ -1351,7 +1351,7 @@ public: sal_Int32 createControl( const PDFWriter::AnyWidget& rControl, sal_Int32 nPageNr = -1 ); void beginControlAppearance( sal_Int32 nControl ); bool endControlAppearance( PDFWriter::WidgetState eState ); - + // additional streams void addStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress ); |