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 
41 namespace com::sun::star::beans { class XMaterialHolder; }
42 namespace com::sun::star::io { class XOutputStream; }
43 namespace com::sun::star::security { class XCertificate; }
44 
45 class GDIMetaFile;
46 class MapMode;
47 class LineInfo;
48 namespace tools {
49  class Polygon;
50  class PolyPolygon;
51 }
52 class Bitmap;
53 class BitmapEx;
54 class Gradient;
55 class Hatch;
56 class Wallpaper;
57 
58 namespace vcl
59 {
60 
61 class PDFExtOutDevData;
62 class PDFWriterImpl;
63 
64 struct 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 };
70 
72 {
73  public:
74  virtual ~PDFOutputStream();
75  virtual void write( const css::uno::Reference< css::io::XOutputStream >& xStream ) = 0;
76 };
77 
79 {
81 
82  PDFWriter(const PDFWriter&) = delete;
83  PDFWriter& operator=(const PDFWriter&) = delete;
84 
85 public:
86  // extended line info
87  enum CapType { capButt, capRound, capSquare };
88  enum JoinType { joinMiter, joinRound, joinBevel };
89  struct ExtLineInfo
90  {
91  double m_fLineWidth;
95  double m_fMiterLimit;
96  std::vector< double > m_aDashArray;
97 
98  ExtLineInfo() : m_fLineWidth( 0.0 ),
99  m_fTransparency( 0.0 ),
100  m_eCap( capButt ),
101  m_eJoin( joinMiter ),
102  m_fMiterLimit( 10.0 )
103  {}
104  };
105 
106  enum class Orientation { Portrait, Inherit };
107 
108  // in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
109  enum class PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_1_6, PDF_A_1, PDF_A_2, PDF_A_3 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
110  // for the meaning of DestAreaType please look at PDF Reference Manual
111  // version 1.4 section 8.2.1, page 475
112  enum class DestAreaType { XYZ, FitRectangle };
113 
114  // for a definition of structural element types please refer to
115  // PDF Reference, 3rd ed. section 9.7.4
117  {
118  // special element to place outside the structure hierarchy
120  // Grouping elements
121  Document, Part, Article, Section, Division, BlockQuote,
122  Caption, TOC, TOCI, Index,
123 
124  // block level elements
125  Paragraph, Heading, H1, H2, H3, H4, H5, H6,
126  List, ListItem, LILabel, LIBody,
127  Table, TableRow, TableHeader, TableData,
128 
129  // inline level elements
130  Span, Quote, Note, Reference, BibEntry, Code, Link,
131 
132  // illustration elements
133  Figure, Formula, Form
134  };
135 
137  {
138  Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
139  TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
141  RowSpan, ColSpan,
142 
143  // link destination is an artificial attribute that sets
144  // the link annotation ID of a Link element
145  // further note: since structure attributes can only be
146  // set during content creation, but links can be
147  // created after the fact, it is possible to set
148  // an arbitrary id as structure attribute here. In this
149  // case the arbitrary id has to be passed again when the
150  // actual link annotation is created via SetLinkPropertyID
152  // Language currently sets a LanguageType (see i18nlangtag/lang.h)
153  // which will be internally changed to a corresponding locale
154  Language
155  };
156 
158  {
161  // Placement
163  // WritingMode
164  LrTb, RlTb, TbRl,
165  // TextAlign
167  // Width, Height,
169  // BlockAlign
171  // LineHeight
173  // TextDecorationType
174  Underline, Overline, LineThrough,
175  // ListNumbering
176  Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
177  };
178 
179  enum class PageTransition
180  {
181  Regular,
182  SplitHorizontalInward, SplitHorizontalOutward,
183  SplitVerticalInward, SplitVerticalOutward,
184  BlindsHorizontal, BlindsVertical,
185  BoxInward, BoxOutward,
186  WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
187  Dissolve
188  };
189 
191  {
193  Signature
194  };
195 
197  {
198  // transparent object occurred and was draw opaque because
199  // PDF/A does not allow transparency
201 
202  // transparent object occurred but is only supported since
203  // PDF 1.4
205 
206  // a form action was exported that is not suitable for PDF/A
207  // the action was skipped
209 
210  // transparent objects were converted to a bitmap in order
211  // to removetransparencies from the output
213 
214  // signature generation failed
216  };
217 
218  struct UNLESS_MERGELIBS(VCL_DLLPUBLIC) AnyWidget
219  {
220  WidgetType Type; // primitive RTTI
221  public:
222  OUString Name; // a distinct name to identify the control
223  OUString Description;// descriptive text for the control (e.g. for tool tip)
224  OUString Text; // user text to appear on the control
225  DrawTextFlags TextStyle; // style flags
226  bool ReadOnly;
227  tools::Rectangle Location; // describes the area filled by the control
228  bool Border; // true: widget should have a border, false: no border
229  Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
230  bool Background; // true: widget shall draw its background, false: no background
231  Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
232  vcl::Font TextFont; // an empty font will be replaced by the
233  // appropriate font from the user settings
234  Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
235  sal_Int32 TabOrder; // lowest number is first in tab order
236 
237  /* style flags for text are those for OutputDevice::DrawText
238  allowed values are:
239  DrawTextFlags::Left, DrawTextFlags::Center, DrawTextFlags::Right, DrawTextFlags::Top,
240  DrawTextFlags::VCenter, DrawTextFlags::Bottom,
241  DrawTextFlags::MultiLine, DrawTextFlags::WordBreak
242 
243  if TextStyle is 0, then each control will fill in default values
244  */
245 
246  // note: the Name member comprises the field name of the resulting
247  // PDF field names need to be globally unique. Therefore if any
248  // Widget with an already used name is created, the name will be
249  // made unique by adding an underscore ('_') and an ascending number
250  // to the name.
251 
252  AnyWidget( WidgetType eType ) :
253  Type( eType ),
254  TextStyle( DrawTextFlags::NONE ),
255  ReadOnly( false ),
256  Border( false ),
257  BorderColor( COL_TRANSPARENT ),
258  Background( false ),
259  BackgroundColor( COL_TRANSPARENT ),
260  TextColor( COL_TRANSPARENT ),
261  TabOrder( -1 )
262  {}
263  virtual ~AnyWidget();
264 
265  WidgetType getType() const { return Type; }
266 
267  virtual std::shared_ptr<AnyWidget> Clone() const = 0;
268 
269  protected:
270  // note that this equals the default compiler-generated copy-ctor, but we want to have it
271  // protected, to only allow sub classes to access it
272  AnyWidget( const AnyWidget& rSource )
273  :Type( rSource.Type )
274  ,Name( rSource.Name )
275  ,Description( rSource.Description )
276  ,Text( rSource.Text )
277  ,TextStyle( rSource.TextStyle )
278  ,ReadOnly( rSource.ReadOnly )
279  ,Location( rSource.Location )
280  ,Border( rSource.Border )
281  ,BorderColor( rSource.BorderColor )
282  ,Background( rSource.Background )
283  ,BackgroundColor( rSource.BackgroundColor )
284  ,TextFont( rSource.TextFont )
285  ,TextColor( rSource.TextColor )
286  ,TabOrder( rSource.TabOrder )
287  {
288  }
289  AnyWidget& operator=( const AnyWidget& ); // never implemented
290  };
291 
292  struct PushButtonWidget final : public AnyWidget
293  {
294  /* If Dest is set to a valid link destination,
295  Then pressing the button will act as a goto
296  action within the document.
297 
298  Else:
299  An empty URL means this button will reset the form.
300 
301  If URL is not empty and Submit is set, then the URL
302  contained will be set as the URL to submit the
303  form to. In this case the submit method will be
304  either GET if SubmitGet is true or POST if
305  SubmitGet is false.
306 
307  If URL is not empty and Submit is clear, then
308  the URL contained will be interpreted as a
309  hyperlink to be executed on pushing the button.
310 
311  There will be no error checking or any kind of
312  conversion done to the URL parameter execept this:
313  it will be output as 7bit Ascii. The URL
314  will appear literally in the PDF file produced
315  */
316  sal_Int32 Dest;
317  OUString URL;
318  bool Submit;
319  bool SubmitGet;
320 
322  : AnyWidget( vcl::PDFWriter::PushButton ),
323  Dest( -1 ), Submit( false ), SubmitGet( false )
324  {}
325 
326  virtual std::shared_ptr<AnyWidget> Clone() const override
327  {
328  return std::make_shared<PushButtonWidget>( *this );
329  }
330  };
331 
332  struct CheckBoxWidget final : public AnyWidget
333  {
334  bool Checked;
335 
337  : AnyWidget( vcl::PDFWriter::CheckBox ),
338  Checked( false )
339  {}
340 
341  virtual std::shared_ptr<AnyWidget> Clone() const override
342  {
343  return std::make_shared<CheckBoxWidget>( *this );
344  }
345  };
346 
347  struct RadioButtonWidget final : public AnyWidget
348  {
349  bool Selected;
350  sal_Int32 RadioGroup;
351  OUString OnValue; // the value of the radio button if it is selected
352 
354  : AnyWidget( vcl::PDFWriter::RadioButton ),
355  Selected( false ),
356  RadioGroup( 0 )
357  {}
358 
359  virtual std::shared_ptr<AnyWidget> Clone() const override
360  {
361  return std::make_shared<RadioButtonWidget>( *this );
362  }
363  // radio buttons having the same RadioGroup id comprise one
364  // logical radio button group, that is at most one of the RadioButtons
365  // in a group can be checked at any time
366  //
367  // note: a PDF radio button field consists of a named field
368  // containing unnamed checkbox child fields. The name of the
369  // radio button field is taken from the first RadioButtonWidget created
370  // in the group
371  };
372 
373  struct EditWidget final : public AnyWidget
374  {
375  bool MultiLine; // whether multiple lines are allowed
376  bool Password; // visible echo off
377  bool FileSelect; // field is a file selector
378  sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
379 
381  : AnyWidget( vcl::PDFWriter::Edit ),
382  MultiLine( false ),
383  Password( false ),
384  FileSelect( false ),
385  MaxLen( 0 )
386  {}
387 
388  virtual std::shared_ptr<AnyWidget> Clone() const override
389  {
390  return std::make_shared<EditWidget>( *this );
391  }
392  };
393 
394  struct ListBoxWidget final : public AnyWidget
395  {
396  bool DropDown;
398  std::vector<OUString> Entries;
399  std::vector<sal_Int32> SelectedEntries;
400  // if MultiSelect is false only the first entry of SelectedEntries
401  // will be taken into account. the same is implicit for PDF < 1.4
402  // since multiselect is a 1.4+ feature
403 
405  : AnyWidget( vcl::PDFWriter::ListBox ),
406  DropDown( false ),
407  MultiSelect( false )
408  {}
409 
410  virtual std::shared_ptr<AnyWidget> Clone() const override
411  {
412  return std::make_shared<ListBoxWidget>( *this );
413  }
414  };
415 
416  // note: PDF only supports dropdown comboboxes
417  struct ComboBoxWidget final : public AnyWidget
418  {
419  std::vector<OUString> Entries;
420  // set the current value in AnyWidget::Text
421 
423  : AnyWidget( vcl::PDFWriter::ComboBox )
424  {}
425 
426  virtual std::shared_ptr<AnyWidget> Clone() const override
427  {
428  return std::make_shared<ComboBoxWidget>( *this );
429  }
430  };
431 
432  struct SignatureWidget final : public AnyWidget
433  {
435  : AnyWidget( vcl::PDFWriter::Signature )
436  {}
437 
438  virtual std::shared_ptr<AnyWidget> Clone() const override
439  {
440  return std::make_shared<SignatureWidget>( *this );
441  }
442  };
443 
444  enum ExportDataFormat { HTML, XML, FDF, PDF };
445 // see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
446 // These emuns are treated as integer while reading/writing to configuration
448  {
451  UseThumbs
452  };
453 // These emuns are treated as integer while reading/writing to configuration
455  {
460  ActionZoom
461  };
462 // These enums are treated as integer while reading/writing to configuration
464  {
468  ContinuousFacing
469  };
470 
471  // These emuns are treated as integer while reading/writing to configuration
472  //what default action to generate in a PDF hyperlink to external document/site
474  {
477  LaunchAction
478  };
479 
480 /*
481 The following structure describes the permissions used in PDF security
482  */
484  {
485 
486  //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.
491  //for revision 3 (bit 128 security) only
496 
497  // encryption will only happen if EncryptionKey is not empty
498  // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
499  // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
500  // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
501  // PDFDocInfo, Owner password and User password used the InitEncryption method which
502  // implements the algorithms described in the PDF reference chapter 3.5: Encryption
503  std::vector<sal_uInt8> OValue;
504  std::vector<sal_uInt8> UValue;
505  std::vector<sal_uInt8> EncryptionKey;
506  std::vector<sal_uInt8> DocumentIdentifier;
507 
508  //permission default set for 128 bit, accessibility only
510  CanPrintTheDocument ( false ),
511  CanModifyTheContent ( false ),
512  CanCopyOrExtract ( false ),
513  CanAddOrModify ( false ),
514  CanFillInteractive ( false ),
515  CanExtractForAccessibility ( true ),
516  CanAssemble ( false ),
517  CanPrintFull ( false )
518  {}
519 
520 
521  bool Encrypt() const
522  { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
523  };
524 
525  struct PDFDocInfo
526  {
527  OUString Title; // document title
528  OUString Author; // document author
529  OUString Subject; // subject
530  OUString Keywords; // keywords
531  OUString Creator; // application that created the original document
532  OUString Producer; // OpenOffice
533  };
534 
536  {
537  DrawColor, DrawGreyscale
538  };
539 
541  {
542  /* must be a valid file: URL usable by osl */
543  OUString URL;
544  /* the URL of the document being exported, used for relative links*/
545  OUString BaseURL;
546  /*if relative to file system should be formed*/
547  bool RelFsys;//i56629, i49415?, i64585?
548  /*the action to set the PDF hyperlink to*/
550  //convert the .od? target file type in a link to a .pdf type
551  //this is examined before doing anything else
553  //when the file type is .pdf, force the GoToR action
555 
556  /* decides the PDF language level to be produced */
558 
559  /* PDF/UA compliance */
561 
562  /* valid for PDF >= 1.4
563  causes the MarkInfo entry in the document catalog to be set
564  */
565  bool Tagged;
566  /* determines in which format a form
567  will be submitted.
568  */
571  /* the following data members are used to customize the PDF viewer
572  preferences
573  */
574  /* see 3.6.1 PDF v 1.4 ref*/
577  // in percent, valid only if PDFDocumentAction == ActionZoom
578  sal_Int32 Zoom;
579 
580  /* see 8.6 PDF v 1.4 ref
581  specifies whether to hide the viewer tool
582  bars when the document is active.
583  */
587  bool FitWindow;
593  // initially visible page in viewer (starting with 0 for first page)
594  sal_Int32 InitialPage;
595  sal_Int32 OpenBookmarkLevels; // -1 means all levels
596 
599 
600  bool SignPDF;
601  OUString SignLocation;
602  OUString SignPassword;
603  OUString SignReason;
604  OUString SignContact;
605  css::lang::Locale DocumentLocale; // defines the document default language
606  sal_uInt32 DPIx, DPIy; // how to handle MapMode( MapUnit::MapPixel )
607  // 0 here specifies a default handling
609  css::uno::Reference< css::security::XCertificate> SignCertificate;
610  OUString SignTSA;
613 
615  RelFsys( false ), //i56629, i49415?, i64585?
616  DefaultLinkAction( PDFWriter::URIAction ),
617  ConvertOOoTargetToPDFTarget( false ),
618  ForcePDFAction( false ),
619  Version( PDFWriter::PDFVersion::PDF_1_6 ),
620  UniversalAccessibilityCompliance( false ),
621  Tagged( false ),
622  SubmitFormat( PDFWriter::FDF ),
623  AllowDuplicateFieldNames( false ),
624  PDFDocumentMode( PDFWriter::ModeDefault ),
625  PDFDocumentAction( PDFWriter::ActionDefault ),
626  Zoom( 100 ),
627  HideViewerToolbar( false ),
628  HideViewerMenubar( false ),
629  HideViewerWindowControls( false ),
630  FitWindow( false ),
631  OpenInFullScreenMode( false ),
632  CenterWindow( false ),
633  DisplayPDFDocumentTitle( true ),
634  PageLayout( PDFWriter::DefaultLayout ),
635  FirstPageLeft( false ),
636  InitialPage( 1 ),
637  OpenBookmarkLevels( -1 ),
638  SignPDF( false ),
639  DPIx( 0 ),
640  DPIy( 0 ),
641  ColorMode( PDFWriter::DrawColor ),
642  UseReferenceXObject( false )
643  {}
644  };
645 
646  PDFWriter( const PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >& );
647  ~PDFWriter();
648 
656  OutputDevice* GetReferenceDevice();
657 
666  void NewPage( double nPageWidth, double nPageHeight, Orientation eOrientation = Orientation::Inherit );
670  {
675 
677  : m_nMaxImageResolution( 0 )
678  , m_bOnlyLosslessCompression( false )
679  , m_nJPEGQuality( 90 )
680  , m_bTransparenciesWereRemoved( false )
681  {}
682 
683  };
684  void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = nullptr );
685 
686  /* sets the document locale originally passed with the context to a new value
687  * only affects the output if used before calling Emit.
688  */
689  void SetDocumentLocale( const css::lang::Locale& rDocLocale );
690 
691  /* finishes the file */
692  bool Emit();
693 
694  /*
695  * Get a list of errors that occurred during processing
696  * this should enable the producer to give feedback about
697  * any anomalies that might have occurred
698  */
699  std::set< ErrorCode > const & GetErrors() const;
700 
701  // uses 128bit encryption
702  static css::uno::Reference< css::beans::XMaterialHolder >
703  InitEncryption( const OUString& i_rOwnerPassword,
704  const OUString& i_rUserPassword
705  );
706 
707  /* functions for graphics state */
708  /* flag values: see vcl/outdev.hxx */
709  void Push( PushFlags nFlags = PushFlags::ALL );
710  void Pop();
711 
712  void SetClipRegion();
713  void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
714  void MoveClipRegion( tools::Long nHorzMove, tools::Long nVertMove );
715  void IntersectClipRegion( const tools::Rectangle& rRect );
716  void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
717 
718  void SetLayoutMode( vcl::text::ComplexTextLayoutFlags nMode );
719  void SetDigitLanguage( LanguageType eLang );
720 
721  void SetLineColor( const Color& rColor );
723 
724  void SetFillColor( const Color& rColor );
726 
727  void SetFont( const vcl::Font& rNewFont );
728  void SetTextColor( const Color& rColor );
729  void SetTextFillColor();
730  void SetTextFillColor( const Color& rColor );
731 
732  void SetTextLineColor();
733  void SetTextLineColor( const Color& rColor );
734  void SetOverlineColor();
735  void SetOverlineColor( const Color& rColor );
736  void SetTextAlign( ::TextAlign eAlign );
737 
738  void SetMapMode( const MapMode& rNewMapMode );
739 
740 
741  /* actual drawing functions */
742  void DrawText( const Point& rPos, const OUString& rText );
743 
744  void DrawTextLine( const Point& rPos, tools::Long nWidth,
745  FontStrikeout eStrikeout,
746  FontLineStyle eUnderline,
747  FontLineStyle eOverline );
748  void DrawTextArray( const Point& rStartPt, const OUString& rStr,
749  const tools::Long* pDXAry,
750  sal_Int32 nIndex,
751  sal_Int32 nLen );
752  void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
753  const OUString& rStr,
754  sal_Int32 nIndex, sal_Int32 nLen );
755  void DrawText( const tools::Rectangle& rRect,
756  const OUString& rStr, DrawTextFlags nStyle );
757 
758  void DrawPixel( const Point& rPt, const Color& rColor );
759  void DrawPixel( const Point& rPt )
760  { DrawPixel( rPt, COL_TRANSPARENT ); }
761 
762  void DrawLine( const Point& rStartPt, const Point& rEndPt );
763  void DrawLine( const Point& rStartPt, const Point& rEndPt,
764  const LineInfo& rLineInfo );
765  void DrawPolyLine( const tools::Polygon& rPoly );
766  void DrawPolyLine( const tools::Polygon& rPoly,
767  const LineInfo& rLineInfo );
768  void DrawPolyLine( const tools::Polygon& rPoly, const ExtLineInfo& rInfo );
769  void DrawPolygon( const tools::Polygon& rPoly );
770  void DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly );
771  void DrawRect( const tools::Rectangle& rRect );
772  void DrawRect( const tools::Rectangle& rRect,
773  sal_uLong nHorzRount, sal_uLong nVertRound );
774  void DrawEllipse( const tools::Rectangle& rRect );
775  void DrawArc( const tools::Rectangle& rRect,
776  const Point& rStartPt, const Point& rEndPt );
777  void DrawPie( const tools::Rectangle& rRect,
778  const Point& rStartPt, const Point& rEndPt );
779  void DrawChord( const tools::Rectangle& rRect,
780  const Point& rStartPt, const Point& rEndPt );
781 
782  void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
783  const Bitmap& rBitmap, const Graphic& rGraphic );
784 
785  void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
786  const BitmapEx& rBitmapEx );
787 
788  void DrawGradient( const tools::Rectangle& rRect, const Gradient& rGradient );
789  void DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient );
790 
791  void DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch );
792 
793  void DrawWallpaper( const tools::Rectangle& rRect, const Wallpaper& rWallpaper );
794  void DrawTransparent( const tools::PolyPolygon& rPolyPoly,
795  sal_uInt16 nTransparencePercent );
796 
815  void BeginTransparencyGroup();
816 
828  void EndTransparencyGroup( const tools::Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
829 
849  void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const tools::Rectangle& rTargetArea, const AlphaMask& rAlphaMask, const Graphic& rGraphic );
850 
870  sal_Int32 CreateNamedDest( const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
887  sal_Int32 CreateDest( const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
902  sal_Int32 CreateLink( const tools::Rectangle& rRect, sal_Int32 nPageNr );
903 
905  sal_Int32 CreateScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr);
906 
929  sal_Int32 RegisterDestReference( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType );
930 
931 
941  void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
952  void SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
953 
955  void SetScreenURL(sal_Int32 nScreenId, const OUString& rURL);
957  void SetScreenStream(sal_Int32 nScreenId, const OUString& rURL);
958 
985  void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
1002  sal_Int32 CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID );
1003 
1017  void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr );
1018 
1061  sal_Int32 BeginStructureElement( enum StructElement eType, const OUString& rAlias );
1069  void EndStructureElement();
1082  void SetCurrentStructureElement( sal_Int32 nElement );
1083 
1097  void SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
1111  void SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
1122  void SetStructureBoundingBox( const tools::Rectangle& rRect );
1123 
1134  void SetActualText( const OUString& rText );
1135 
1145  void SetAlternateText( const OUString& rText );
1146 
1160  void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr );
1161 
1174  sal_Int32 CreateControl( const AnyWidget& rControlType );
1175 
1193  void AddStream( const OUString& rMimeType, PDFOutputStream* pStream );
1194 
1196  static void AppendUnicodeTextString(const OUString& rString, OStringBuffer& rBuffer);
1197 
1199  static OString GetDateTime();
1200 };
1201 
1202 VCL_DLLPUBLIC void escapeStringXML( const OUString& rStr, OUString &rValue);
1203 
1204 }
1205 
1206 #endif // INCLUDED_VCL_PDFWRITER_HXX
1207 
1208 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:326
PDFWriter::PDFViewerAction PDFDocumentAction
Definition: pdfwriter.hxx:576
Type
std::vector< sal_Int32 > SelectedEntries
Definition: pdfwriter.hxx:399
bool UseReferenceXObject
Use reference XObject markup for PDF images.
Definition: pdfwriter.hxx:612
Definition: hatch.hxx:46
void escapeStringXML(const OUString &rStr, OUString &rValue)
void DrawPixel(const Point &rPt)
Definition: pdfwriter.hxx:759
OUString Title
Definition: pdfwriter.hxx:66
OUString Contents
Definition: pdfwriter.hxx:67
bool getType(BSTR name, Type &type)
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:82
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
sal_uIntPtr sal_uLong
long Long
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
PDFWriter::ExportDataFormat SubmitFormat
Definition: pdfwriter.hxx:569
Regular
css::uno::Reference< css::security::XCertificate > SignCertificate
Definition: pdfwriter.hxx:609
Reference
css::util::DateTime maModificationDate
Definition: pdfwriter.hxx:68
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:359
PDFWriter::PDFDocInfo DocumentInfo
Definition: pdfwriter.hxx:598
DateTime GetDateTime(const css::util::DateTime &_rDT)
OUString Name
Center
DrawTextFlags
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:438
PDFWriter::ColorMode ColorMode
Definition: pdfwriter.hxx:608
Play a metafile like an outputdevice would do.
Definition: pdfwriter.hxx:669
Reference< XInputStream > xStream
Definition: edit.hxx:55
std::vector< sal_uInt8 > DocumentIdentifier
Definition: pdfwriter.hxx:506
DocumentType eType
void DrawLine(OutputDevice &rDev, const basegfx::B2DPoint &rP1, const basegfx::B2DPoint &rP2, sal_uInt32 nWidth, SvxBorderLineStyle nDashing)
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:388
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
ComplexTextLayoutFlags
Definition: State.hxx:76
BaselineShift
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:168
PDFWriter::PDFEncryptionProperties Encryption
Definition: pdfwriter.hxx:597
std::vector< sal_uInt8 > EncryptionKey
Definition: pdfwriter.hxx:505
PushFlags
Definition: State.hxx:40
std::vector< OUString > Entries
Definition: pdfwriter.hxx:398
void SetLineColor()
Definition: pdfwriter.hxx:722
TextAlign
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:410
std::vector< OUString > Entries
Definition: pdfwriter.hxx:419
void SetFillColor()
Definition: pdfwriter.hxx:725
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:426
ScopedVclPtr< PDFWriterImpl > xImplementation
Definition: pdfwriter.hxx:80
virtual std::shared_ptr< AnyWidget > Clone() const override
Definition: pdfwriter.hxx:341
Orientation
Definition: prntypes.hxx:31
SQLUSMALLINT SQLCHAR SQLSMALLINT SQLSMALLINT SQLCHAR * Description
PDFWriter::PDFLinkDefaultAction DefaultLinkAction
Definition: pdfwriter.hxx:549
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:38
std::vector< double > m_aDashArray
Definition: pdfwriter.hxx:96
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
PDFWriter::PDFViewerPageMode PDFDocumentMode
Definition: pdfwriter.hxx:575
FontLineStyle
std::vector< sal_uInt8 > UValue
Definition: pdfwriter.hxx:504
struct _ADOIndex Index
css::lang::Locale DocumentLocale
Definition: pdfwriter.hxx:605
FontStrikeout
std::vector< sal_uInt8 > OValue
Definition: pdfwriter.hxx:503