LibreOffice Module vcl (master) 1
pdfwriter.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#ifndef INCLUDED_VCL_PDFWRITER_HXX
20#define INCLUDED_VCL_PDFWRITER_HXX
21
22#include <config_options.h>
23#include <sal/types.h>
24
25#include <tools/gen.hxx>
26#include <tools/color.hxx>
27#include <rtl/strbuf.hxx>
28
29#include <vcl/dllapi.h>
30#include <vcl/font.hxx>
31#include <vcl/outdev.hxx>
32#include <vcl/graph.hxx>
33
34#include <com/sun/star/lang/Locale.hpp>
35#include <com/sun/star/util/DateTime.hpp>
36
37#include <memory>
38#include <vector>
39#include <set>
40
41namespace com::sun::star::beans { class XMaterialHolder; }
42namespace com::sun::star::io { class XOutputStream; }
43namespace com::sun::star::security { class XCertificate; }
44
45class GDIMetaFile;
46class MapMode;
47class LineInfo;
48namespace tools {
49 class Polygon;
50 class PolyPolygon;
51}
52class Bitmap;
53class BitmapEx;
54class Gradient;
55class Hatch;
56class Wallpaper;
57
58namespace vcl
59{
60
61class PDFExtOutDevData;
62class PDFWriterImpl;
63
64struct PDFNote
65{
66 OUString Title; // optional title for the popup containing the note
67 OUString Contents; // contents of the note
68 css::util::DateTime maModificationDate;
69 bool isFreeText = false;
70 std::vector<basegfx::B2DPolygon> maPolygons;
73};
74
76{
77 public:
78 virtual ~PDFOutputStream();
79 virtual void write( const css::uno::Reference< css::io::XOutputStream >& xStream ) = 0;
80};
81
83{
85
86 PDFWriter(const PDFWriter&) = delete;
87 PDFWriter& operator=(const PDFWriter&) = delete;
88
89public:
90 // extended line info
91 enum CapType { capButt, capRound, capSquare };
92 enum JoinType { joinMiter, joinRound, joinBevel };
94 {
100 std::vector< double > m_aDashArray;
101
102 ExtLineInfo() : m_fLineWidth( 0.0 ),
103 m_fTransparency( 0.0 ),
104 m_eCap( capButt ),
105 m_eJoin( joinMiter ),
106 m_fMiterLimit( 10.0 )
107 {}
108 };
109
110 enum class Orientation { Portrait, Inherit };
111
112 // in case the below enum is added PDF_2_0, please add just after PDF_1_7
113 enum class PDFVersion { PDF_1_4, PDF_1_5, PDF_1_6, PDF_1_7, PDF_A_1, PDF_A_2, PDF_A_3 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
114 // for the meaning of DestAreaType please look at PDF Reference Manual
115 // version 1.4 section 8.2.1, page 475
116 enum class DestAreaType { XYZ, FitRectangle };
117
118 // for a definition of structural element types please refer to
119 // PDF Reference, 3rd ed. section 9.7.4
121 {
122 // special element to place outside the structure hierarchy
124 // Grouping elements
125 Document, Part, Article, Section, Division, BlockQuote,
126 Caption, TOC, TOCI, Index,
127
128 // block level elements
129 Paragraph, Heading, H1, H2, H3, H4, H5, H6,
130 List, ListItem, LILabel, LIBody,
131 Table, TableRow, TableHeader, TableData,
132
133 // inline level elements
134 Span, Quote, Note, Reference, BibEntry, Code, Link, Annot,
135
136 // illustration elements
138 };
139
141 {
142 // Artifacts
144
145 Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
146 TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
147 LineHeight, BaselineShift, TextDecorationType, ListNumbering,
148 RowSpan, ColSpan, Scope, Role,
149
150 // link destination is an artificial attribute that sets
151 // the link annotation ID of a Link element
152 // further note: since structure attributes can only be
153 // set during content creation, but links can be
154 // created after the fact, it is possible to set
155 // an arbitrary id as structure attribute here. In this
156 // case the arbitrary id has to be passed again when the
157 // actual link annotation is created via SetLinkPropertyID
159 // Language currently sets a LanguageType (see i18nlangtag/lang.h)
160 // which will be internally changed to a corresponding locale
161 Language
162 };
163
165 {
168 // Artifacts
169 Pagination, Layout, Page, Background,
171 // Placement
173 // WritingMode
174 LrTb, RlTb, TbRl,
175 // TextAlign
176 Center, Justify,
177 // Width, Height,
179 // BlockAlign
181 // LineHeight
183 // TextDecorationType
185 // Scope
187 // Role
188 Rb, Cb, Pb, Tv,
189 // ListNumbering
190 Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
191 };
192
193 enum class PageTransition
194 {
195 Regular,
196 SplitHorizontalInward, SplitHorizontalOutward,
197 SplitVerticalInward, SplitVerticalOutward,
198 BlindsHorizontal, BlindsVertical,
199 BoxInward, BoxOutward,
200 WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
201 Dissolve
202 };
203
205 {
208 };
209
211 {
213 };
214
216 {
217 // transparent object occurred and was draw opaque because
218 // PDF/A does not allow transparency
220
221 // transparent object occurred but is only supported since
222 // PDF 1.4
224
225 // a form action was exported that is not suitable for PDF/A
226 // the action was skipped
228
229 // transparent objects were converted to a bitmap in order
230 // to removetransparencies from the output
232
233 // signature generation failed
235 };
236
238 {
239 WidgetType Type; // primitive RTTI
240 public:
241 OUString Name; // a distinct name to identify the control
242 OUString Description;// descriptive text for the control (e.g. for tool tip)
243 OUString Text; // user text to appear on the control
244 DrawTextFlags TextStyle; // style flags
246 tools::Rectangle Location; // describes the area filled by the control
247 bool Border; // true: widget should have a border, false: no border
248 Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
249 bool Background; // true: widget shall draw its background, false: no background
250 Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
251 vcl::Font TextFont; // an empty font will be replaced by the
252 // appropriate font from the user settings
253 Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
254 sal_Int32 TabOrder; // lowest number is first in tab order
255
256 /* style flags for text are those for OutputDevice::DrawText
257 allowed values are:
258 DrawTextFlags::Left, DrawTextFlags::Center, DrawTextFlags::Right, DrawTextFlags::Top,
259 DrawTextFlags::VCenter, DrawTextFlags::Bottom,
260 DrawTextFlags::MultiLine, DrawTextFlags::WordBreak
261
262 if TextStyle is 0, then each control will fill in default values
263 */
264
265 // note: the Name member comprises the field name of the resulting
266 // PDF field names need to be globally unique. Therefore if any
267 // Widget with an already used name is created, the name will be
268 // made unique by adding an underscore ('_') and an ascending number
269 // to the name.
270
272 Type( eType ),
273 TextStyle( DrawTextFlags::NONE ),
274 ReadOnly( false ),
275 Border( false ),
276 BorderColor( COL_TRANSPARENT ),
277 Background( false ),
280 TabOrder( -1 )
281 {}
282 virtual ~AnyWidget();
283
284 WidgetType getType() const { return Type; }
285
286 virtual std::shared_ptr<AnyWidget> Clone() const = 0;
287
288 protected:
289 // note that this equals the default compiler-generated copy-ctor, but we want to have it
290 // protected, to only allow sub classes to access it
291 AnyWidget( const AnyWidget& rSource )
292 :Type( rSource.Type )
293 ,Name( rSource.Name )
294 ,Description( rSource.Description )
295 ,Text( rSource.Text )
296 ,TextStyle( rSource.TextStyle )
297 ,ReadOnly( rSource.ReadOnly )
298 ,Location( rSource.Location )
299 ,Border( rSource.Border )
300 ,BorderColor( rSource.BorderColor )
301 ,Background( rSource.Background )
303 ,TextFont( rSource.TextFont )
304 ,TextColor( rSource.TextColor )
305 ,TabOrder( rSource.TabOrder )
306 {
307 }
308 AnyWidget& operator=( const AnyWidget& ) = delete; // never implemented
309 };
310
311 struct PushButtonWidget final : public AnyWidget
312 {
313 /* If Dest is set to a valid link destination,
314 Then pressing the button will act as a goto
315 action within the document.
316
317 Else:
318 An empty URL means this button will reset the form.
319
320 If URL is not empty and Submit is set, then the URL
321 contained will be set as the URL to submit the
322 form to. In this case the submit method will be
323 either GET if SubmitGet is true or POST if
324 SubmitGet is false.
325
326 If URL is not empty and Submit is clear, then
327 the URL contained will be interpreted as a
328 hyperlink to be executed on pushing the button.
329
330 There will be no error checking or any kind of
331 conversion done to the URL parameter except this:
332 it will be output as 7bit Ascii. The URL
333 will appear literally in the PDF file produced
334 */
335 sal_Int32 Dest;
336 OUString URL;
337 bool Submit;
339
342 Dest( -1 ), Submit( false ), SubmitGet( false )
343 {}
344
345 virtual std::shared_ptr<AnyWidget> Clone() const override
346 {
347 return std::make_shared<PushButtonWidget>( *this );
348 }
349 };
350
352 {
354 OUString OnValue; // the value of the checkbox if it is selected
355 OUString OffValue; // the value of the checkbox if it is not selected
356
359 Checked( false )
360 {}
361
362 virtual std::shared_ptr<AnyWidget> Clone() const override
363 {
364 return std::make_shared<CheckBoxWidget>( *this );
365 }
366 };
367
368 struct RadioButtonWidget final : public AnyWidget
369 {
371 sal_Int32 RadioGroup;
372 OUString OnValue; // the value of the radio button if it is selected
373 OUString OffValue; // the value of the radio button if it is not selected
374
377 Selected( false ),
378 RadioGroup( 0 )
379 {}
380
381 virtual std::shared_ptr<AnyWidget> Clone() const override
382 {
383 return std::make_shared<RadioButtonWidget>( *this );
384 }
385 // radio buttons having the same RadioGroup id comprise one
386 // logical radio button group, that is at most one of the RadioButtons
387 // in a group can be checked at any time
388 //
389 // note: a PDF radio button field consists of a named field
390 // containing unnamed checkbox child fields. The name of the
391 // radio button field is taken from the first RadioButtonWidget created
392 // in the group
393 };
394
395 struct VCL_DLLPUBLIC EditWidget final : public AnyWidget
396 {
397 bool MultiLine; // whether multiple lines are allowed
398 bool Password; // visible echo off
399 bool FileSelect; // field is a file selector
400 sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
405 OUString TimeFormat;
406 OUString DateFormat;
407
410 MultiLine( false ),
411 Password( false ),
412 FileSelect( false ),
413 MaxLen( 0 ),
415 DecimalAccuracy ( 0 ),
416 PrependCurrencySymbol( false )
417 {}
418
419 virtual std::shared_ptr<AnyWidget> Clone() const override
420 {
421 return std::make_shared<EditWidget>( *this );
422 }
423 };
424
426 {
429 std::vector<OUString> Entries;
430 std::vector<sal_Int32> SelectedEntries;
431 // if MultiSelect is false only the first entry of SelectedEntries
432 // will be taken into account. the same is implicit for PDF < 1.4
433 // since multiselect is a 1.4+ feature
434
437 DropDown( false ),
438 MultiSelect( false )
439 {}
440
441 virtual std::shared_ptr<AnyWidget> Clone() const override
442 {
443 return std::make_shared<ListBoxWidget>( *this );
444 }
445 };
446
447 // note: PDF only supports dropdown comboboxes
448 struct ComboBoxWidget final : public AnyWidget
449 {
450 std::vector<OUString> Entries;
451 // set the current value in AnyWidget::Text
452
455 {}
456
457 virtual std::shared_ptr<AnyWidget> Clone() const override
458 {
459 return std::make_shared<ComboBoxWidget>( *this );
460 }
461 };
462
463 struct SignatureWidget final : public AnyWidget
464 {
467 {}
468
469 virtual std::shared_ptr<AnyWidget> Clone() const override
470 {
471 return std::make_shared<SignatureWidget>( *this );
472 }
473 };
474
475 enum ExportDataFormat { HTML, XML, FDF, PDF };
476// see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
477// These emuns are treated as integer while reading/writing to configuration
479 {
482 UseThumbs
483 };
484// These emuns are treated as integer while reading/writing to configuration
486 {
491 ActionZoom
492 };
493// These enums are treated as integer while reading/writing to configuration
495 {
499 ContinuousFacing
500 };
501
502 // These emuns are treated as integer while reading/writing to configuration
503 //what default action to generate in a PDF hyperlink to external document/site
505 {
508 LaunchAction
509 };
510
511/*
512The following structure describes the permissions used in PDF security
513 */
515 {
516
517 //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
522 //for revision 3 (bit 128 security) only
527
528 // encryption will only happen if EncryptionKey is not empty
529 // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
530 // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
531 // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
532 // PDFDocInfo, Owner password and User password used the InitEncryption method which
533 // implements the algorithms described in the PDF reference chapter 3.5: Encryption
534 std::vector<sal_uInt8> OValue;
535 std::vector<sal_uInt8> UValue;
536 std::vector<sal_uInt8> EncryptionKey;
537 std::vector<sal_uInt8> DocumentIdentifier;
538
539 //permission default set for 128 bit, accessibility only
541 CanPrintTheDocument ( false ),
542 CanModifyTheContent ( false ),
543 CanCopyOrExtract ( false ),
544 CanAddOrModify ( false ),
545 CanFillInteractive ( false ),
546 CanExtractForAccessibility ( true ),
547 CanAssemble ( false ),
548 CanPrintFull ( false )
549 {}
550
551
552 bool Encrypt() const
553 { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
554 };
555
557 {
558 OUString Title; // document title
559 OUString Author; // document author
560 OUString Subject; // subject
561 OUString Keywords; // keywords
562 OUString Creator; // application that created the original document
563 OUString Producer; // OpenOffice
564 };
565
567 {
568 DrawColor, DrawGreyscale
569 };
570
572 {
573 /* must be a valid file: URL usable by osl */
574 OUString URL;
575 /* the URL of the document being exported, used for relative links*/
576 OUString BaseURL;
577 /*if relative to file system should be formed*/
578 bool RelFsys;//i56629, i49415?, i64585?
579 /*the action to set the PDF hyperlink to*/
581 //convert the .od? target file type in a link to a .pdf type
582 //this is examined before doing anything else
584 //when the file type is .pdf, force the GoToR action
586
587 /* decides the PDF language level to be produced */
589
590 /* PDF/UA compliance */
592
593 /* valid for PDF >= 1.4
594 causes the MarkInfo entry in the document catalog to be set
595 */
596 bool Tagged;
597 /* determines in which format a form
598 will be submitted.
599 */
602 /* the following data members are used to customize the PDF viewer
603 preferences
604 */
605 /* see 3.6.1 PDF v 1.4 ref*/
608 // in percent, valid only if PDFDocumentAction == ActionZoom
609 sal_Int32 Zoom;
610
611 /* see 8.6 PDF v 1.4 ref
612 specifies whether to hide the viewer tool
613 bars when the document is active.
614 */
624 // initially visible page in viewer (starting with 0 for first page)
625 sal_Int32 InitialPage;
626 sal_Int32 OpenBookmarkLevels; // -1 means all levels
627
630
632 OUString SignLocation;
633 OUString SignPassword;
634 OUString SignReason;
635 OUString SignContact;
636 css::lang::Locale DocumentLocale; // defines the document default language
637 sal_uInt32 DPIx, DPIy; // how to handle MapMode( MapUnit::MapPixel )
638 // 0 here specifies a default handling
640 css::uno::Reference< css::security::XCertificate> SignCertificate;
641 OUString SignTSA;
644
646 RelFsys( false ), //i56629, i49415?, i64585?
647 DefaultLinkAction( PDFWriter::URIAction ),
648 ConvertOOoTargetToPDFTarget( false ),
649 ForcePDFAction( false ),
650 Version(PDFWriter::PDFVersion::PDF_1_7),
651 UniversalAccessibilityCompliance( false ),
652 Tagged( false ),
653 SubmitFormat( PDFWriter::FDF ),
654 AllowDuplicateFieldNames( false ),
655 PDFDocumentMode( PDFWriter::ModeDefault ),
656 PDFDocumentAction( PDFWriter::ActionDefault ),
657 Zoom( 100 ),
658 HideViewerToolbar( false ),
659 HideViewerMenubar( false ),
660 HideViewerWindowControls( false ),
661 FitWindow( false ),
662 OpenInFullScreenMode( false ),
663 CenterWindow( false ),
664 DisplayPDFDocumentTitle( true ),
665 PageLayout( PDFWriter::DefaultLayout ),
666 FirstPageLeft( false ),
667 InitialPage( 1 ),
668 OpenBookmarkLevels( -1 ),
669 SignPDF( false ),
670 DPIx( 0 ),
671 DPIy( 0 ),
672 ColorMode( PDFWriter::DrawColor ),
673 UseReferenceXObject( false )
674 {}
675 };
676
677 PDFWriter( const PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >& );
678 ~PDFWriter();
679
687 OutputDevice* GetReferenceDevice();
688
697 void NewPage( double nPageWidth, double nPageHeight, Orientation eOrientation = Orientation::Inherit );
701 {
706
708 : m_nMaxImageResolution( 0 )
709 , m_bOnlyLosslessCompression( false )
710 , m_nJPEGQuality( 90 )
711 , m_bTransparenciesWereRemoved( false )
712 {}
713
714 };
715 void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = nullptr );
716
717 /* sets the document locale originally passed with the context to a new value
718 * only affects the output if used before calling Emit.
719 */
720 void SetDocumentLocale( const css::lang::Locale& rDocLocale );
721
722 /* finishes the file */
723 bool Emit();
724
725 /*
726 * Get a list of errors that occurred during processing
727 * this should enable the producer to give feedback about
728 * any anomalies that might have occurred
729 */
730 std::set< ErrorCode > const & GetErrors() const;
731
732 // uses 128bit encryption
733 static css::uno::Reference< css::beans::XMaterialHolder >
734 InitEncryption( const OUString& i_rOwnerPassword,
735 const OUString& i_rUserPassword
736 );
737
738 /* functions for graphics state */
739 /* flag values: see vcl/outdev.hxx */
740 void Push( PushFlags nFlags = PushFlags::ALL );
741 void Pop();
742
743 void SetClipRegion();
744 void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
745 void MoveClipRegion( tools::Long nHorzMove, tools::Long nVertMove );
746 void IntersectClipRegion( const tools::Rectangle& rRect );
747 void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
748
749 void SetLayoutMode( vcl::text::ComplexTextLayoutFlags nMode );
750 void SetDigitLanguage( LanguageType eLang );
751
752 void SetLineColor( const Color& rColor );
754
755 void SetFillColor( const Color& rColor );
757
758 void SetFont( const vcl::Font& rNewFont );
759 void SetTextColor( const Color& rColor );
760 void SetTextFillColor();
761 void SetTextFillColor( const Color& rColor );
762
763 void SetTextLineColor();
764 void SetTextLineColor( const Color& rColor );
765 void SetOverlineColor();
766 void SetOverlineColor( const Color& rColor );
767 void SetTextAlign( ::TextAlign eAlign );
768
769 void SetMapMode( const MapMode& rNewMapMode );
770
771
772 /* actual drawing functions */
773 void DrawText( const Point& rPos, const OUString& rText );
774
775 void DrawTextLine( const Point& rPos, tools::Long nWidth,
776 FontStrikeout eStrikeout,
777 FontLineStyle eUnderline,
778 FontLineStyle eOverline );
779 void DrawTextArray( const Point& rStartPt, const OUString& rStr,
780 KernArraySpan aKernArray,
781 o3tl::span<const sal_Bool> pKashidaAry,
782 sal_Int32 nIndex,
783 sal_Int32 nLen );
784 void DrawStretchText( const Point& rStartPt, sal_Int32 nWidth,
785 const OUString& rStr,
786 sal_Int32 nIndex, sal_Int32 nLen );
787 void DrawText( const tools::Rectangle& rRect,
788 const OUString& rStr, DrawTextFlags nStyle );
789
790 void DrawPixel( const Point& rPt, const Color& rColor );
791 void DrawPixel( const Point& rPt )
792 { DrawPixel( rPt, COL_TRANSPARENT ); }
793
794 void DrawLine( const Point& rStartPt, const Point& rEndPt );
795 void DrawLine( const Point& rStartPt, const Point& rEndPt,
796 const LineInfo& rLineInfo );
797 void DrawPolyLine( const tools::Polygon& rPoly );
798 void DrawPolyLine( const tools::Polygon& rPoly,
799 const LineInfo& rLineInfo );
800 void DrawPolyLine( const tools::Polygon& rPoly, const ExtLineInfo& rInfo );
801 void DrawPolygon( const tools::Polygon& rPoly );
802 void DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly );
803 void DrawRect( const tools::Rectangle& rRect );
804 void DrawRect( const tools::Rectangle& rRect,
805 sal_uInt32 nHorzRount, sal_uInt32 nVertRound );
806 void DrawEllipse( const tools::Rectangle& rRect );
807 void DrawArc( const tools::Rectangle& rRect,
808 const Point& rStartPt, const Point& rEndPt );
809 void DrawPie( const tools::Rectangle& rRect,
810 const Point& rStartPt, const Point& rEndPt );
811 void DrawChord( const tools::Rectangle& rRect,
812 const Point& rStartPt, const Point& rEndPt );
813
814 void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
815 const Bitmap& rBitmap, const Graphic& rGraphic );
816
817 void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
818 const BitmapEx& rBitmapEx );
819
820 void DrawGradient( const tools::Rectangle& rRect, const Gradient& rGradient );
821 void DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient );
822
823 void DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch );
824
825 void DrawWallpaper( const tools::Rectangle& rRect, const Wallpaper& rWallpaper );
826 void DrawTransparent( const tools::PolyPolygon& rPolyPoly,
827 sal_uInt16 nTransparencePercent );
828
847 void BeginTransparencyGroup();
848
860 void EndTransparencyGroup( const tools::Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
861
881 void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const tools::Rectangle& rTargetArea, const AlphaMask& rAlphaMask, const Graphic& rGraphic );
882
902 sal_Int32 CreateNamedDest( const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
919 sal_Int32 CreateDest( const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
934 sal_Int32 CreateLink(const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString const& rAltText);
935
937 sal_Int32 CreateScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr, OUString const& rAltText, OUString const& rMimeType);
938
961 sal_Int32 RegisterDestReference( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
962
963
973 void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
984 void SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
985
987 void SetScreenURL(sal_Int32 nScreenId, const OUString& rURL);
989 void SetScreenStream(sal_Int32 nScreenId, const OUString& rURL);
990
1017 void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
1034 sal_Int32 CreateOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID );
1035
1049 void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr );
1050
1098 void BeginStructureElement(sal_Int32 id);
1099 sal_Int32 EnsureStructureElement();
1100 void InitStructureElement(sal_Int32 id, PDFWriter::StructElement eType, std::u16string_view rAlias);
1101
1109 void EndStructureElement();
1122 void SetCurrentStructureElement( sal_Int32 nElement );
1123
1137 void SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
1151 void SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
1162 void SetStructureBoundingBox( const tools::Rectangle& rRect );
1163
1167 void SetStructureAnnotIds(::std::vector<sal_Int32> const& rAnnotIds);
1168
1179 void SetActualText( const OUString& rText );
1180
1190 void SetAlternateText( const OUString& rText );
1191
1205 void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1206
1219 sal_Int32 CreateControl( const AnyWidget& rControlType );
1220
1238 void AddAttachedFile(OUString const& rFileName, OUString const& rMimeType, OUString const& rDescription, std::unique_ptr<PDFOutputStream> pStream);
1239
1241 static void AppendUnicodeTextString(const OUString& rString, OStringBuffer& rBuffer);
1242
1244 static OString GetDateTime();
1245};
1246
1247}
1248
1249#endif // INCLUDED_VCL_PDFWRITER_HXX
1250
1251/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOColumn Column
struct _ADOIndex Index
DrawTextFlags
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:39
Definition: edit.hxx:56
Definition: hatch.hxx:47
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:83
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
virtual void write(const css::uno::Reference< css::io::XOutputStream > &xStream)=0
void SetLineColor()
Definition: pdfwriter.hxx:753
PDFWriter & operator=(const PDFWriter &)=delete
PDFWriter(const PDFWriter &)=delete
@ Warning_Transparency_Omitted_PDFA
Definition: pdfwriter.hxx:219
@ Warning_Transparency_Omitted_PDF13
Definition: pdfwriter.hxx:223
@ Warning_Transparency_Converted
Definition: pdfwriter.hxx:231
@ Warning_FormAction_Omitted_PDFA
Definition: pdfwriter.hxx:227
void SetFillColor()
Definition: pdfwriter.hxx:756
void DrawPixel(const Point &rPt)
Definition: pdfwriter.hxx:791
ScopedVclPtr< PDFWriterImpl > xImplementation
Definition: pdfwriter.hxx:84
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
DocumentType eType
FontLineStyle
FontStrikeout
NONE
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
Type
Reference
Header
Layout
Regular
TextAlign
void DrawLine(OutputDevice &rDev, const basegfx::B2DPoint &rP1, const basegfx::B2DPoint &rP2, sal_uInt32 nWidth, SvxBorderLineStyle nDashing)
long Long
DateTime GetDateTime(const css::util::DateTime &_rDT)
ComplexTextLayoutFlags
Definition: State.hxx:76
PushFlags
Definition: State.hxx:40
Placement
Definition: weld.hxx:2390
Orientation
Definition: prntypes.hxx:31
Color annotColor
Definition: pdfwriter.hxx:71
std::vector< basegfx::B2DPolygon > maPolygons
Definition: pdfwriter.hxx:70
OUString Contents
Definition: pdfwriter.hxx:67
OUString Title
Definition: pdfwriter.hxx:66
bool isFreeText
Definition: pdfwriter.hxx:69
Color interiorColor
Definition: pdfwriter.hxx:72
css::util::DateTime maModificationDate
Definition: pdfwriter.hxx:68
virtual std::shared_ptr< AnyWidget > Clone() const =0
tools::Rectangle Location
Definition: pdfwriter.hxx:246
WidgetType getType() const
Definition: pdfwriter.hxx:284
AnyWidget & operator=(const AnyWidget &)=delete
AnyWidget(const AnyWidget &rSource)
Definition: pdfwriter.hxx:291
AnyWidget(WidgetType eType)
Definition: pdfwriter.hxx:271
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:362
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:457
std::vector< OUString > Entries
Definition: pdfwriter.hxx:450
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:419
std::vector< double > m_aDashArray
Definition: pdfwriter.hxx:100
std::vector< OUString > Entries
Definition: pdfwriter.hxx:429
std::vector< sal_Int32 > SelectedEntries
Definition: pdfwriter.hxx:430
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:441
std::vector< sal_uInt8 > UValue
Definition: pdfwriter.hxx:535
std::vector< sal_uInt8 > DocumentIdentifier
Definition: pdfwriter.hxx:537
std::vector< sal_uInt8 > EncryptionKey
Definition: pdfwriter.hxx:536
std::vector< sal_uInt8 > OValue
Definition: pdfwriter.hxx:534
PDFWriter::PDFLinkDefaultAction DefaultLinkAction
Definition: pdfwriter.hxx:580
PDFWriter::ExportDataFormat SubmitFormat
Definition: pdfwriter.hxx:600
css::uno::Reference< css::security::XCertificate > SignCertificate
Definition: pdfwriter.hxx:640
bool UseReferenceXObject
Use reference XObject markup for PDF images.
Definition: pdfwriter.hxx:643
PDFWriter::PDFViewerPageMode PDFDocumentMode
Definition: pdfwriter.hxx:606
PDFWriter::PDFViewerAction PDFDocumentAction
Definition: pdfwriter.hxx:607
PDFWriter::PDFEncryptionProperties Encryption
Definition: pdfwriter.hxx:628
PDFWriter::PDFDocInfo DocumentInfo
Definition: pdfwriter.hxx:629
PDFWriter::ColorMode ColorMode
Definition: pdfwriter.hxx:639
css::lang::Locale DocumentLocale
Definition: pdfwriter.hxx:636
Play a metafile like an outputdevice would do.
Definition: pdfwriter.hxx:701
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:345
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:381
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:469
OUString Name
Page