LibreOffice Module vcl (master)  1
pdfextoutdevdata.cxx
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 #include <vcl/canvastools.hxx>
21 #include <vcl/pdfextoutdevdata.hxx>
22 #include <vcl/graph.hxx>
23 #include <vcl/outdev.hxx>
24 #include <vcl/gfxlink.hxx>
25 #include <vcl/metaact.hxx>
26 #include <vcl/graphicfilter.hxx>
29 #include <sal/log.hxx>
30 #include <o3tl/safeint.hxx>
31 #include <osl/diagnose.h>
32 #include <tools/stream.hxx>
33 
34 #include <memory>
35 #include <map>
36 
37 namespace vcl
38 {
39 namespace {
40 
41 struct PDFExtOutDevDataSync
42 {
43  enum Action{ CreateNamedDest,
44  CreateDest,
45  CreateLink,
46  CreateScreen,
47  SetLinkDest,
48  SetLinkURL,
49  SetScreenURL,
50  SetScreenStream,
51  RegisterDest,
52  CreateOutlineItem,
53  CreateNote,
54  SetPageTransition,
55 
56  BeginStructureElement,
57  EndStructureElement,
58  SetCurrentStructureElement,
59  SetStructureAttribute,
60  SetStructureAttributeNumerical,
61  SetStructureBoundingBox,
62  SetActualText,
63  SetAlternateText,
64  CreateControl,
65  BeginGroup,
66  EndGroupGfxLink
67  };
68 
69  sal_uInt32 nIdx;
70  Action eAct;
71 };
72 
73 struct PDFLinkDestination
74 {
75  tools::Rectangle mRect;
76  MapMode mMapMode;
77  sal_Int32 mPageNr;
78  PDFWriter::DestAreaType mAreaType;
79 };
80 
81 }
82 
84 {
85  std::deque< PDFExtOutDevDataSync::Action > mActions;
86  std::deque< MapMode > mParaMapModes;
87  std::deque< tools::Rectangle > mParaRects;
88  std::deque< sal_Int32 > mParaInts;
89  std::deque< sal_uInt32 > mParauInts;
90  std::deque< OUString > mParaOUStrings;
91  std::deque< PDFWriter::DestAreaType > mParaDestAreaTypes;
92  std::deque< PDFNote > mParaPDFNotes;
93  std::deque< PDFWriter::PageTransition > mParaPageTransitions;
94  ::std::map< sal_Int32, PDFLinkDestination > mFutureDestinations;
95 
96  sal_Int32 GetMappedId();
97  sal_Int32 GetMappedStructId( sal_Int32 );
98 
99  sal_Int32 mCurId;
100  std::vector< sal_Int32 > mParaIds;
101  std::vector< sal_Int32 > mStructIdMap;
102 
104  std::vector< sal_Int32 > mStructParents;
106  mCurId ( 0 ),
107  mCurrentStructElement( 0 )
108  {
109  mStructParents.push_back( 0 );
110  mStructIdMap.push_back( 0 );
111  }
112  void PlayGlobalActions( PDFWriter& rWriter );
113 };
114 
116 {
117  sal_Int32 nLinkId = mParaInts.front();
118  mParaInts.pop_front();
119 
120  /* negative values are intentionally passed as invalid IDs
121  * e.g. to create a new top level outline item
122  */
123  if( nLinkId >= 0 )
124  {
125  if ( o3tl::make_unsigned(nLinkId) < mParaIds.size() )
126  nLinkId = mParaIds[ nLinkId ];
127  else
128  nLinkId = -1;
129 
130  SAL_WARN_IF( nLinkId < 0, "vcl", "unmapped id in GlobalSyncData" );
131  }
132 
133  return nLinkId;
134 }
135 
136 sal_Int32 GlobalSyncData::GetMappedStructId( sal_Int32 nStructId )
137 {
138  if ( o3tl::make_unsigned(nStructId) < mStructIdMap.size() )
139  nStructId = mStructIdMap[ nStructId ];
140  else
141  nStructId = -1;
142 
143  SAL_WARN_IF( nStructId < 0, "vcl", "unmapped structure id in GlobalSyncData" );
144 
145  return nStructId;
146 }
147 
149 {
150  for (auto const& action : mActions)
151  {
152  switch (action)
153  {
154  case PDFExtOutDevDataSync::CreateNamedDest : //i56629
155  {
156  rWriter.Push( PushFlags::MAPMODE );
157  rWriter.SetMapMode( mParaMapModes.front() );
158  mParaMapModes.pop_front();
159  mParaIds.push_back( rWriter.CreateNamedDest( mParaOUStrings.front(), mParaRects.front(), mParaInts.front(), mParaDestAreaTypes.front() ) );
160  mParaOUStrings.pop_front();
161  mParaRects.pop_front();
162  mParaInts.pop_front();
163  mParaDestAreaTypes.pop_front();
164  rWriter.Pop();
165  }
166  break;
167  case PDFExtOutDevDataSync::CreateDest :
168  {
169  rWriter.Push( PushFlags::MAPMODE );
170  rWriter.SetMapMode( mParaMapModes.front() );
171  mParaMapModes.pop_front();
172  mParaIds.push_back( rWriter.CreateDest( mParaRects.front(), mParaInts.front(), mParaDestAreaTypes.front() ) );
173  mParaRects.pop_front();
174  mParaInts.pop_front();
175  mParaDestAreaTypes.pop_front();
176  rWriter.Pop();
177  }
178  break;
179  case PDFExtOutDevDataSync::CreateLink :
180  {
181  rWriter.Push( PushFlags::MAPMODE );
182  rWriter.SetMapMode( mParaMapModes.front() );
183  mParaMapModes.pop_front();
184  mParaIds.push_back( rWriter.CreateLink( mParaRects.front(), mParaInts.front() ) );
185  // resolve LinkAnnotation structural attribute
186  rWriter.SetLinkPropertyID( mParaIds.back(), sal_Int32(mParaIds.size()-1) );
187  mParaRects.pop_front();
188  mParaInts.pop_front();
189  rWriter.Pop();
190  }
191  break;
192  case PDFExtOutDevDataSync::CreateScreen:
193  {
194  rWriter.Push(PushFlags::MAPMODE);
195  rWriter.SetMapMode(mParaMapModes.front());
196  mParaMapModes.pop_front();
197  mParaIds.push_back(rWriter.CreateScreen(mParaRects.front(), mParaInts.front()));
198  mParaRects.pop_front();
199  mParaInts.pop_front();
200  rWriter.Pop();
201  }
202  break;
203  case PDFExtOutDevDataSync::SetLinkDest :
204  {
205  sal_Int32 nLinkId = GetMappedId();
206  sal_Int32 nDestId = GetMappedId();
207  rWriter.SetLinkDest( nLinkId, nDestId );
208  }
209  break;
210  case PDFExtOutDevDataSync::SetLinkURL :
211  {
212  sal_Int32 nLinkId = GetMappedId();
213  rWriter.SetLinkURL( nLinkId, mParaOUStrings.front() );
214  mParaOUStrings.pop_front();
215  }
216  break;
217  case PDFExtOutDevDataSync::SetScreenURL:
218  {
219  sal_Int32 nScreenId = GetMappedId();
220  rWriter.SetScreenURL(nScreenId, mParaOUStrings.front());
221  mParaOUStrings.pop_front();
222  }
223  break;
224  case PDFExtOutDevDataSync::SetScreenStream:
225  {
226  sal_Int32 nScreenId = GetMappedId();
227  rWriter.SetScreenStream(nScreenId, mParaOUStrings.front());
228  mParaOUStrings.pop_front();
229  }
230  break;
231  case PDFExtOutDevDataSync::RegisterDest :
232  {
233  const sal_Int32 nDestId = mParaInts.front();
234  mParaInts.pop_front();
235  OSL_ENSURE( mFutureDestinations.find( nDestId ) != mFutureDestinations.end(),
236  "GlobalSyncData::PlayGlobalActions: DescribeRegisteredRequest has not been called for that destination!" );
237 
238  PDFLinkDestination& rDest = mFutureDestinations[ nDestId ];
239 
240  rWriter.Push( PushFlags::MAPMODE );
241  rWriter.SetMapMode( rDest.mMapMode );
242  mParaIds.push_back( rWriter.RegisterDestReference( nDestId, rDest.mRect, rDest.mPageNr, rDest.mAreaType ) );
243  rWriter.Pop();
244  }
245  break;
246  case PDFExtOutDevDataSync::CreateOutlineItem :
247  {
248  sal_Int32 nParent = GetMappedId();
249  sal_Int32 nLinkId = GetMappedId();
250  mParaIds.push_back( rWriter.CreateOutlineItem( nParent, mParaOUStrings.front(), nLinkId ) );
251  mParaOUStrings.pop_front();
252  }
253  break;
254  case PDFExtOutDevDataSync::CreateNote :
255  {
256  rWriter.Push( PushFlags::MAPMODE );
257  rWriter.SetMapMode( mParaMapModes.front() );
258  rWriter.CreateNote( mParaRects.front(), mParaPDFNotes.front(), mParaInts.front() );
259  mParaMapModes.pop_front();
260  mParaRects.pop_front();
261  mParaPDFNotes.pop_front();
262  mParaInts.pop_front();
263  }
264  break;
265  case PDFExtOutDevDataSync::SetPageTransition :
266  {
267  rWriter.SetPageTransition( mParaPageTransitions.front(), mParauInts.front(), mParaInts.front() );
268  mParaPageTransitions.pop_front();
269  mParauInts.pop_front();
270  mParaInts.pop_front();
271  }
272  break;
273  case PDFExtOutDevDataSync::BeginStructureElement:
274  case PDFExtOutDevDataSync::EndStructureElement:
275  case PDFExtOutDevDataSync::SetCurrentStructureElement:
276  case PDFExtOutDevDataSync::SetStructureAttribute:
277  case PDFExtOutDevDataSync::SetStructureAttributeNumerical:
278  case PDFExtOutDevDataSync::SetStructureBoundingBox:
279  case PDFExtOutDevDataSync::SetActualText:
280  case PDFExtOutDevDataSync::SetAlternateText:
281  case PDFExtOutDevDataSync::CreateControl:
282  case PDFExtOutDevDataSync::BeginGroup:
283  case PDFExtOutDevDataSync::EndGroupGfxLink:
284  break;
285  }
286  }
287 }
288 
290 {
291  std::deque< PDFExtOutDevDataSync > mActions;
292  std::deque< tools::Rectangle > mParaRects;
293  std::deque< sal_Int32 > mParaInts;
294  std::deque< OUString > mParaOUStrings;
295  std::deque< PDFWriter::StructElement > mParaStructElements;
296  std::deque< PDFWriter::StructAttribute > mParaStructAttributes;
297  std::deque< PDFWriter::StructAttributeValue > mParaStructAttributeValues;
298  std::deque< Graphic > mGraphics;
300  std::deque< std::shared_ptr< PDFWriter::AnyWidget > >
303 
305 
306 
307  explicit PageSyncData( GlobalSyncData* pGlobal )
308  : mbGroupIgnoreGDIMtfActions ( false )
309  { mpGlobalData = pGlobal; }
310 
311  void PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDataSync::Action eAct );
312  bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf, const PDFExtOutDevData& rOutDevData );
313 };
314 
315 void PageSyncData::PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDataSync::Action eAct )
316 {
317  GDIMetaFile* pMtf = rOutDev.GetConnectMetaFile();
318  SAL_WARN_IF( !pMtf, "vcl", "PageSyncData::PushAction -> no ConnectMetaFile !!!" );
319 
320  PDFExtOutDevDataSync aSync;
321  aSync.eAct = eAct;
322  if ( pMtf )
323  aSync.nIdx = pMtf->GetActionSize();
324  else
325  aSync.nIdx = 0x7fffffff; // sync not possible
326  mActions.push_back( aSync );
327 }
328 bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf, const PDFExtOutDevData& rOutDevData )
329 {
330  bool bRet = false;
331  if ( !mActions.empty() && ( mActions.front().nIdx == rCurGDIMtfAction ) )
332  {
333  bRet = true;
334  PDFExtOutDevDataSync aDataSync = mActions.front();
335  mActions.pop_front();
336  switch( aDataSync.eAct )
337  {
338  case PDFExtOutDevDataSync::BeginStructureElement :
339  {
340  sal_Int32 nNewEl = rWriter.BeginStructureElement( mParaStructElements.front(), mParaOUStrings.front() ) ;
341  mParaStructElements.pop_front();
342  mParaOUStrings.pop_front();
343  mpGlobalData->mStructIdMap.push_back( nNewEl );
344  }
345  break;
346  case PDFExtOutDevDataSync::EndStructureElement :
347  {
348  rWriter.EndStructureElement();
349  }
350  break;
351  case PDFExtOutDevDataSync::SetCurrentStructureElement:
352  {
354  mParaInts.pop_front();
355  }
356  break;
357  case PDFExtOutDevDataSync::SetStructureAttribute :
358  {
360  mParaStructAttributeValues.pop_front();
361  mParaStructAttributes.pop_front();
362  }
363  break;
364  case PDFExtOutDevDataSync::SetStructureAttributeNumerical :
365  {
367  mParaStructAttributes.pop_front();
368  mParaInts.pop_front();
369  }
370  break;
371  case PDFExtOutDevDataSync::SetStructureBoundingBox :
372  {
373  rWriter.SetStructureBoundingBox( mParaRects.front() );
374  mParaRects.pop_front();
375  }
376  break;
377  case PDFExtOutDevDataSync::SetActualText :
378  {
379  rWriter.SetActualText( mParaOUStrings.front() );
380  mParaOUStrings.pop_front();
381  }
382  break;
383  case PDFExtOutDevDataSync::SetAlternateText :
384  {
385  rWriter.SetAlternateText( mParaOUStrings.front() );
386  mParaOUStrings.pop_front();
387  }
388  break;
389  case PDFExtOutDevDataSync::CreateControl:
390  {
391  std::shared_ptr< PDFWriter::AnyWidget > pControl( mControls.front() );
392  SAL_WARN_IF( !pControl, "vcl", "PageSyncData::PlaySyncPageAct: invalid widget!" );
393  if ( pControl )
394  rWriter.CreateControl( *pControl );
395  mControls.pop_front();
396  }
397  break;
398  case PDFExtOutDevDataSync::BeginGroup :
399  {
400  /* first determining if this BeginGroup is starting a GfxLink,
401  by searching for an EndGroup or an EndGroupGfxLink */
403  auto isStartingGfxLink = std::any_of(mActions.begin(), mActions.end(),
404  [](const PDFExtOutDevDataSync& rAction) { return rAction.eAct == PDFExtOutDevDataSync::EndGroupGfxLink; });
405  if ( isStartingGfxLink )
406  {
407  Graphic& rGraphic = mGraphics.front();
408  if ( rGraphic.IsGfxLink() && mParaRects.size() >= 2 )
409  {
410  GfxLinkType eType = rGraphic.GetGfxLink().GetType();
411  if ( eType == GfxLinkType::NativeJpg )
412  {
415  mCurrentGraphic = rGraphic;
416  }
417  else if ( eType == GfxLinkType::NativePng || eType == GfxLinkType::NativePdf )
418  {
419  if ( eType == GfxLinkType::NativePdf || rOutDevData.HasAdequateCompression(rGraphic, mParaRects[0], mParaRects[1]) )
420  mCurrentGraphic = rGraphic;
421  }
422  }
423  }
424  }
425  break;
426  case PDFExtOutDevDataSync::EndGroupGfxLink :
427  {
428  tools::Rectangle aOutputRect, aVisibleOutputRect;
429  Graphic aGraphic( mGraphics.front() );
430 
431  mGraphics.pop_front();
432  sal_Int32 nTransparency = mParaInts.front();
433  mParaInts.pop_front();
434  aOutputRect = mParaRects.front();
435  mParaRects.pop_front();
436  aVisibleOutputRect = mParaRects.front();
437  mParaRects.pop_front();
438 
440  {
441  bool bClippingNeeded = ( aOutputRect != aVisibleOutputRect ) && !aVisibleOutputRect.IsEmpty();
442 
443  GfxLink aGfxLink( aGraphic.GetGfxLink() );
444  if ( aGfxLink.GetType() == GfxLinkType::NativeJpg )
445  {
446  if ( bClippingNeeded )
447  {
448  rWriter.Push();
450  vcl::unotools::b2DRectangleFromRectangle(aVisibleOutputRect) ) );
451  rWriter.SetClipRegion( aRect);
452  }
453 
454  Bitmap aMask;
455  if (nTransparency)
456  {
457  AlphaMask aAlphaMask(aGraphic.GetSizePixel());
458  aAlphaMask.Erase(nTransparency);
459  aMask = aAlphaMask.GetBitmap();
460  }
461 
462  SvMemoryStream aTmp;
463  const sal_uInt8* pData = aGfxLink.GetData();
464  sal_uInt32 nBytes = aGfxLink.GetDataSize();
465  if( pData && nBytes )
466  {
467  aTmp.WriteBytes( pData, nBytes );
468 
469  // Look up the output rectangle from the previous
470  // bitmap scale action if possible. This has the
471  // correct position and size for images with a
472  // custom translation (Writer header) or scaling
473  // (Impress notes page).
474  if (rCurGDIMtfAction > 0)
475  {
476  const MetaAction* pAction = rMtf.GetAction(rCurGDIMtfAction - 1);
477  if (pAction && pAction->GetType() == MetaActionType::BMPSCALE)
478  {
479  const MetaBmpScaleAction* pA
480  = static_cast<const MetaBmpScaleAction*>(pAction);
481  aOutputRect.SetPos(pA->GetPoint());
482  aOutputRect.SetSize(pA->GetSize());
483  }
484  }
485 
486  rWriter.DrawJPGBitmap( aTmp, aGraphic.GetBitmapEx().GetBitCount() > 8, aGraphic.GetSizePixel(), aOutputRect, aMask, aGraphic );
487  }
488 
489  if ( bClippingNeeded )
490  rWriter.Pop();
491  }
493  }
495  }
496  break;
497  case PDFExtOutDevDataSync::CreateNamedDest:
498  case PDFExtOutDevDataSync::CreateDest:
499  case PDFExtOutDevDataSync::CreateLink:
500  case PDFExtOutDevDataSync::CreateScreen:
501  case PDFExtOutDevDataSync::SetLinkDest:
502  case PDFExtOutDevDataSync::SetLinkURL:
503  case PDFExtOutDevDataSync::SetScreenURL:
504  case PDFExtOutDevDataSync::SetScreenStream:
505  case PDFExtOutDevDataSync::RegisterDest:
506  case PDFExtOutDevDataSync::CreateOutlineItem:
507  case PDFExtOutDevDataSync::CreateNote:
508  case PDFExtOutDevDataSync::SetPageTransition:
509  break;
510  }
511  }
512  else if ( mbGroupIgnoreGDIMtfActions )
513  {
514  rCurGDIMtfAction++;
515  bRet = true;
516  }
517  return bRet;
518 }
519 
521  mrOutDev ( rOutDev ),
522  mbTaggedPDF ( false ),
523  mbExportNotes ( true ),
524  mbExportNotesPages ( false ),
525  mbTransitionEffects ( true ),
526  mbUseLosslessCompression( true ),
527  mbReduceImageResolution ( false ),
528  mbExportFormFields ( false ),
529  mbExportBookmarks ( false ),
530  mbExportHiddenSlides ( false ),
531  mbSinglePageSheets ( false ),
532  mbExportNDests ( false ),
533  mnPage ( -1 ),
534  mnCompressionQuality ( 90 ),
535  mpGlobalSyncData ( new GlobalSyncData() )
536 {
537  mpPageSyncData.reset( new PageSyncData( mpGlobalSyncData.get() ) );
538 }
539 
541 {
542  mpPageSyncData.reset();
543  mpGlobalSyncData.reset();
544 }
545 
547 {
548  return mpPageSyncData->mCurrentGraphic;
549 }
550 
551 void PDFExtOutDevData::SetDocumentLocale( const css::lang::Locale& rLoc )
552 {
553  maDocLocale = rLoc;
554 }
555 void PDFExtOutDevData::SetCurrentPageNumber( const sal_Int32 nPage )
556 {
557  mnPage = nPage;
558 }
559 void PDFExtOutDevData::SetIsLosslessCompression( const bool bUseLosslessCompression )
560 {
561  mbUseLosslessCompression = bUseLosslessCompression;
562 }
563 void PDFExtOutDevData::SetCompressionQuality( const sal_Int32 nQuality )
564 {
565  mnCompressionQuality = nQuality;
566 }
567 void PDFExtOutDevData::SetIsReduceImageResolution( const bool bReduceImageResolution )
568 {
569  mbReduceImageResolution = bReduceImageResolution;
570 }
571 void PDFExtOutDevData::SetIsExportNotes( const bool bExportNotes )
572 {
573  mbExportNotes = bExportNotes;
574 }
575 void PDFExtOutDevData::SetIsExportNotesPages( const bool bExportNotesPages )
576 {
577  mbExportNotesPages = bExportNotesPages;
578 }
579 void PDFExtOutDevData::SetIsExportTaggedPDF( const bool bTaggedPDF )
580 {
581  mbTaggedPDF = bTaggedPDF;
582 }
583 void PDFExtOutDevData::SetIsExportTransitionEffects( const bool bTransitionEffects )
584 {
585  mbTransitionEffects = bTransitionEffects;
586 }
587 void PDFExtOutDevData::SetIsExportFormFields( const bool bExportFomtFields )
588 {
589  mbExportFormFields = bExportFomtFields;
590 }
591 void PDFExtOutDevData::SetIsExportBookmarks( const bool bExportBookmarks )
592 {
593  mbExportBookmarks = bExportBookmarks;
594 }
595 void PDFExtOutDevData::SetIsExportHiddenSlides( const bool bExportHiddenSlides )
596 {
597  mbExportHiddenSlides = bExportHiddenSlides;
598 }
599 void PDFExtOutDevData::SetIsSinglePageSheets( const bool bSinglePageSheets )
600 {
601  mbSinglePageSheets = bSinglePageSheets;
602 }
603 void PDFExtOutDevData::SetIsExportNamedDestinations( const bool bExportNDests )
604 {
605  mbExportNDests = bExportNDests;
606 }
608 {
610 }
611 bool PDFExtOutDevData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rIdx, const GDIMetaFile& rMtf )
612 {
613  return mpPageSyncData->PlaySyncPageAct( rWriter, rIdx, rMtf, *this );
614 }
616 {
617  mpGlobalSyncData->PlayGlobalActions( rWriter );
618 }
619 
620 /* global actions, synchronisation to the recorded metafile isn't needed,
621  all actions will be played after the last page was recorded
622 */
623 //--->i56629
624 sal_Int32 PDFExtOutDevData::CreateNamedDest(const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr )
625 {
626  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateNamedDest );
627  mpGlobalSyncData->mParaOUStrings.push_back( sDestName );
628  mpGlobalSyncData->mParaRects.push_back( rRect );
629  mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() );
630  mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr );
631  mpGlobalSyncData->mParaDestAreaTypes.push_back( PDFWriter::DestAreaType::XYZ );
632 
633  return mpGlobalSyncData->mCurId++;
634 }
635 //<---i56629
637 {
638  const sal_Int32 nLinkDestID = mpGlobalSyncData->mCurId++;
639  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::RegisterDest );
640  mpGlobalSyncData->mParaInts.push_back( nLinkDestID );
641 
642  return nLinkDestID;
643 }
644 void PDFExtOutDevData::DescribeRegisteredDest( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
645 {
646  OSL_PRECOND( nDestId != -1, "PDFExtOutDevData::DescribeRegisteredDest: invalid destination Id!" );
647  PDFLinkDestination aLinkDestination;
648  aLinkDestination.mRect = rRect;
649  aLinkDestination.mMapMode = mrOutDev.GetMapMode();
650  aLinkDestination.mPageNr = nPageNr == -1 ? mnPage : nPageNr;
651  aLinkDestination.mAreaType = eType;
652  mpGlobalSyncData->mFutureDestinations[ nDestId ] = aLinkDestination;
653 }
654 sal_Int32 PDFExtOutDevData::CreateDest( const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
655 {
656  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateDest );
657  mpGlobalSyncData->mParaRects.push_back( rRect );
658  mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() );
659  mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr );
660  mpGlobalSyncData->mParaDestAreaTypes.push_back( eType );
661  return mpGlobalSyncData->mCurId++;
662 }
663 sal_Int32 PDFExtOutDevData::CreateLink( const tools::Rectangle& rRect, sal_Int32 nPageNr )
664 {
665  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateLink );
666  mpGlobalSyncData->mParaRects.push_back( rRect );
667  mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() );
668  mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr );
669  return mpGlobalSyncData->mCurId++;
670 }
671 
672 sal_Int32 PDFExtOutDevData::CreateScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr)
673 {
674  mpGlobalSyncData->mActions.push_back(PDFExtOutDevDataSync::CreateScreen);
675  mpGlobalSyncData->mParaRects.push_back(rRect);
676  mpGlobalSyncData->mParaMapModes.push_back(mrOutDev.GetMapMode());
677  mpGlobalSyncData->mParaInts.push_back(nPageNr);
678  return mpGlobalSyncData->mCurId++;
679 }
680 
681 void PDFExtOutDevData::SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId )
682 {
683  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::SetLinkDest );
684  mpGlobalSyncData->mParaInts.push_back( nLinkId );
685  mpGlobalSyncData->mParaInts.push_back( nDestId );
686 }
687 void PDFExtOutDevData::SetLinkURL( sal_Int32 nLinkId, const OUString& rURL )
688 {
689  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::SetLinkURL );
690  mpGlobalSyncData->mParaInts.push_back( nLinkId );
691  mpGlobalSyncData->mParaOUStrings.push_back( rURL );
692 }
693 
694 void PDFExtOutDevData::SetScreenURL(sal_Int32 nScreenId, const OUString& rURL)
695 {
696  mpGlobalSyncData->mActions.push_back(PDFExtOutDevDataSync::SetScreenURL);
697  mpGlobalSyncData->mParaInts.push_back(nScreenId);
698  mpGlobalSyncData->mParaOUStrings.push_back(rURL);
699 }
700 
701 void PDFExtOutDevData::SetScreenStream(sal_Int32 nScreenId, const OUString& rURL)
702 {
703  mpGlobalSyncData->mActions.push_back(PDFExtOutDevDataSync::SetScreenStream);
704  mpGlobalSyncData->mParaInts.push_back(nScreenId);
705  mpGlobalSyncData->mParaOUStrings.push_back(rURL);
706 }
707 
708 sal_Int32 PDFExtOutDevData::CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID )
709 {
710  if (nParent == -1)
711  // Has no parent, it's a chapter / heading 1.
712  maChapterNames.push_back(rText);
713 
714  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateOutlineItem );
715  mpGlobalSyncData->mParaInts.push_back( nParent );
716  mpGlobalSyncData->mParaOUStrings.push_back( rText );
717  mpGlobalSyncData->mParaInts.push_back( nDestID );
718  return mpGlobalSyncData->mCurId++;
719 }
720 void PDFExtOutDevData::CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr )
721 {
722  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateNote );
723  mpGlobalSyncData->mParaRects.push_back( rRect );
724  mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() );
725  mpGlobalSyncData->mParaPDFNotes.push_back( rNote );
726  mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr );
727 }
729 {
730  mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::SetPageTransition );
731  mpGlobalSyncData->mParaPageTransitions.push_back( eType );
732  mpGlobalSyncData->mParauInts.push_back( nMilliSec );
733  mpGlobalSyncData->mParaInts.push_back( mnPage );
734 }
735 
736 /* local (page), actions have to be played synchronously to the actions of
737  of the recorded metafile (created by each xRenderable->render()) */
738  sal_Int32 PDFExtOutDevData::BeginStructureElement( PDFWriter::StructElement eType, const OUString& rAlias )
739 {
740  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::BeginStructureElement );
741  mpPageSyncData->mParaStructElements.push_back( eType );
742  mpPageSyncData->mParaOUStrings.push_back( rAlias );
743  // need a global id
744  sal_Int32 nNewId = mpGlobalSyncData->mStructParents.size();
745  mpGlobalSyncData->mStructParents.push_back( mpGlobalSyncData->mCurrentStructElement );
746  mpGlobalSyncData->mCurrentStructElement = nNewId;
747  return nNewId;
748 }
750 {
751  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::EndStructureElement );
752  mpGlobalSyncData->mCurrentStructElement = mpGlobalSyncData->mStructParents[ mpGlobalSyncData->mCurrentStructElement ];
753 }
755 {
756  bool bSuccess = false;
757  if( o3tl::make_unsigned(nStructId) < mpGlobalSyncData->mStructParents.size() )
758  {
759  mpGlobalSyncData->mCurrentStructElement = nStructId;
760  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::SetCurrentStructureElement );
761  mpPageSyncData->mParaInts.push_back( nStructId );
762  bSuccess = true;
763  }
764  return bSuccess;
765 }
767 {
768  return mpGlobalSyncData->mCurrentStructElement;
769 }
771 {
772  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::SetStructureAttribute );
773  mpPageSyncData->mParaStructAttributes.push_back( eAttr );
774  mpPageSyncData->mParaStructAttributeValues.push_back( eVal );
775 }
777 {
778  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::SetStructureAttributeNumerical );
779  mpPageSyncData->mParaStructAttributes.push_back( eAttr );
780  mpPageSyncData->mParaInts.push_back( nValue );
781 }
783 {
784  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::SetStructureBoundingBox );
785  mpPageSyncData->mParaRects.push_back( rRect );
786 }
787 void PDFExtOutDevData::SetActualText( const OUString& rText )
788 {
789  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::SetActualText );
790  mpPageSyncData->mParaOUStrings.push_back( rText );
791 }
792 void PDFExtOutDevData::SetAlternateText( const OUString& rText )
793 {
794  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::SetAlternateText );
795  mpPageSyncData->mParaOUStrings.push_back( rText );
796 }
797 
798 void PDFExtOutDevData::CreateControl( const PDFWriter::AnyWidget& rControlType )
799 {
800  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::CreateControl );
801 
802  std::shared_ptr< PDFWriter::AnyWidget > pClone( rControlType.Clone() );
803  mpPageSyncData->mControls.push_back( pClone );
804 }
805 
807 {
808  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::BeginGroup );
809 }
810 
811 void PDFExtOutDevData::EndGroup( const Graphic& rGraphic,
812  sal_uInt8 nTransparency,
813  const tools::Rectangle& rOutputRect,
814  const tools::Rectangle& rVisibleOutputRect )
815 {
816  mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::EndGroupGfxLink );
817  mpPageSyncData->mGraphics.push_back( rGraphic );
818  mpPageSyncData->mParaInts.push_back( nTransparency );
819  mpPageSyncData->mParaRects.push_back( rOutputRect );
820  mpPageSyncData->mParaRects.push_back( rVisibleOutputRect );
821 }
822 
823 // Avoids expensive de-compression and re-compression of large images.
825  const tools::Rectangle & rOutputRect,
826  const tools::Rectangle & rVisibleOutputRect ) const
827 {
828  assert(rGraphic.IsGfxLink() &&
829  (rGraphic.GetGfxLink().GetType() == GfxLinkType::NativeJpg ||
830  rGraphic.GetGfxLink().GetType() == GfxLinkType::NativePng ||
831  rGraphic.GetGfxLink().GetType() == GfxLinkType::NativePdf));
832 
833  if (rOutputRect != rVisibleOutputRect)
834  // rOutputRect is the crop rectangle, re-compress cropped image.
835  return false;
836 
838  // Reducing resolution was requested, implies that re-compressing is
839  // wanted.
840  return false;
841 
842  if (rGraphic.GetGfxLink().GetDataSize() == 0)
843  return false;
844 
845  GfxLink aLink = rGraphic.GetGfxLink();
846  SvMemoryStream aMemoryStream(const_cast<sal_uInt8*>(aLink.GetData()), aLink.GetDataSize(),
847  StreamMode::READ | StreamMode::WRITE);
848  GraphicDescriptor aDescriptor(aMemoryStream, nullptr);
849  if (aDescriptor.Detect(true) && aDescriptor.GetNumberOfImageComponents() == 4)
850  // 4 means CMYK, which is not handled.
851  return false;
852 
853  const Size aSize = rGraphic.GetSizePixel();
854 
855  // small items better off as PNG anyway
856  if ( aSize.Width() < 32 &&
857  aSize.Height() < 32 )
858  return false;
859 
861  return !GetIsReduceImageResolution();
862 
863  // FIXME: ideally we'd also pre-empt the DPI related scaling too.
864  sal_Int32 nCurrentRatio = (100 * aSize.Width() * aSize.Height() * 4) /
865  rGraphic.GetGfxLink().GetDataSize();
866 
867  static const struct {
868  sal_Int32 mnQuality;
869  sal_Int32 mnRatio;
870  } aRatios[] = { // minimum tolerable compression ratios
871  { 100, 400 }, { 95, 700 }, { 90, 1000 }, { 85, 1200 },
872  { 80, 1500 }, { 75, 1700 }
873  };
874  sal_Int32 nTargetRatio = 10000;
875  bool bIsTargetRatioReached = false;
876  for (auto & rRatio : aRatios)
877  {
878  if ( mnCompressionQuality > rRatio.mnQuality )
879  {
880  bIsTargetRatioReached = true;
881  break;
882  }
883  nTargetRatio = rRatio.mnRatio;
884  }
885 
886  return ((nCurrentRatio > nTargetRatio) && bIsTargetRatioReached);
887 }
888 
889 }
890 
891 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::deque< PDFWriter::StructAttributeValue > mParaStructAttributeValues
void SetCurrentPageNumber(const sal_Int32 nPage)
long Width() const
std::deque< PDFWriter::StructAttribute > mParaStructAttributes
void SetPos(const Point &rPoint)
std::deque< PDFWriter::StructElement > mParaStructElements
void PushAction(const OutputDevice &rOutDev, const PDFExtOutDevDataSync::Action eAct)
const Point & GetPoint() const
Definition: metaact.hxx:705
void SetIsExportNotes(const bool bExportNotes)
void SetPageTransition(PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr)
Sets the transitional effect to be applied when the current page gets shown.
Definition: pdfwriter.cxx:430
void BeginGroup()
Start a new group of render output.
sal_Int32 RegisterDest()
registers a destination for which a destination ID needs to be known immediately, instead of later on...
std::deque< sal_Int32 > mParaInts
std::unique_ptr< ContentProperties > pData
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
Definition: graph.cxx:405
long Height() const
bool PlaySyncPageAct(PDFWriter &rWriter, sal_uInt32 &rCurGDIMtfAction, const GDIMetaFile &rMtf)
bool SetCurrentStructureElement(sal_Int32 nElement)
set the current structure element
void SetScreenURL(sal_Int32 nScreenId, const OUString &rURL)
Set URL for a linked Screen annotation.
void SetAlternateText(const OUString &rText)
set the Alt attribute of a strutural element
sal_Int32 BeginStructureElement(enum StructElement eType, const OUString &rAlias)
begin a new logical structure element
Definition: pdfwriter.cxx:390
std::deque< PDFWriter::DestAreaType > mParaDestAreaTypes
void SetStructureAttribute(PDFWriter::StructAttribute eAttr, PDFWriter::StructAttributeValue eVal)
set a structure attribute on the current structural element
void SetActualText(const OUString &rText)
set the ActualText attribute of a structural element
Definition: pdfwriter.cxx:420
std::deque< sal_Int32 > mParaInts
const Size & GetSize() const
Definition: metaact.hxx:706
const MapMode & GetMapMode() const
Definition: outdev.hxx:1677
void SetIsReduceImageResolution(const bool bReduceImageResolution)
virtual ~PDFExtOutDevData() override
GDIMetaFile * GetConnectMetaFile() const
Definition: outdev.hxx:415
std::deque< tools::Rectangle > mParaRects
void SetIsExportNamedDestinations(const bool bExportNDests)
std::vector< sal_Int32 > mStructParents
bool IsGfxLink() const
Definition: graph.cxx:508
void SetStructureBoundingBox(const tools::Rectangle &rRect)
set the bounding box of a structural element
Definition: pdfwriter.cxx:415
std::unique_ptr< GlobalSyncData > mpGlobalSyncData
bool IsEmpty() const
void Clear()
Definition: graph.cxx:283
bool GetIsLosslessCompression() const
void SetLinkPropertyID(sal_Int32 nLinkId, sal_Int32 nPropertyID)
Resolve link in logical structure.
Definition: pdfwriter.cxx:375
std::deque< std::shared_ptr< PDFWriter::AnyWidget > > mControls
std::deque< sal_uInt32 > mParauInts
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void EndStructureElement()
end the current logical structure element
Definition: pdfwriter.cxx:395
std::vector< sal_Int32 > mParaIds
sal_Int32 CreateNamedDest(const OUString &sDestName, const tools::Rectangle &rRect, sal_Int32 nPageNr, DestAreaType eType)
Create a new named destination to be used in a link from another PDF document.
Definition: pdfwriter.cxx:346
void EndGroup(const Graphic &rGraphic, sal_uInt8 nTransparency, const tools::Rectangle &rOutputRect, const tools::Rectangle &rVisibleOutputRect)
End render output.
void SetLinkDest(sal_Int32 nLinkId, sal_Int32 nDestId)
Set the destination for a link.
PageSyncData(GlobalSyncData *pGlobal)
std::vector< OUString > maChapterNames
sal_Int32 GetCurrentStructureElement() const
get the current structure element id
void DrawJPGBitmap(SvStream &rJPGData, bool bIsTrueColor, const Size &rSrcSizePixel, const tools::Rectangle &rTargetArea, const Bitmap &rMask, const Graphic &rGraphic)
Insert a JPG encoded image (optionally with mask)
Definition: pdfwriter.cxx:326
void SetIsExportFormFields(const bool bExportFormFields)
std::deque< Graphic > mGraphics
DocumentType eType
std::deque< OUString > mParaOUStrings
void SetAlternateText(const OUString &rText)
set the Alt attribute of a strutural element
Definition: pdfwriter.cxx:425
std::deque< PDFExtOutDevDataSync::Action > mActions
void SetIsSinglePageSheets(const bool bSinglePageSheets)
void SetIsExportBookmarks(const bool bExportBookmarks)
void Erase(sal_uInt8 cTransparency)
Definition: alpha.cxx:75
PDFExtOutDevData(const OutputDevice &rOutDev)
void SetLinkDest(sal_Int32 nLinkId, sal_Int32 nDestId)
Set the destination for a link will change a URL type link to a dest link if necessary.
Definition: pdfwriter.cxx:355
void PlayGlobalActions(PDFWriter &rWriter)
void SetCompressionQuality(const sal_Int32 nQuality)
void SetStructureAttributeNumerical(PDFWriter::StructAttribute eAttr, sal_Int32 nValue)
set a structure attribute on the current structural element
void SetIsExportNotesPages(const bool bExportNotesPages)
std::deque< PDFNote > mParaPDFNotes
void SetSize(const Size &rSize)
void SetIsExportHiddenSlides(const bool bExportHiddenSlides)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
GlobalSyncData * mpGlobalData
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:302
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::size_t WriteBytes(const void *pData, std::size_t nSize)
sal_Int32 CreateDest(const tools::Rectangle &rRect, sal_Int32 nPageNr=-1, PDFWriter::DestAreaType eType=PDFWriter::DestAreaType::XYZ)
Create a new destination to be used in a link.
void SetStructureAttributeNumerical(enum StructAttribute eAttr, sal_Int32 nValue)
set a structure attribute on the current structural element
Definition: pdfwriter.cxx:410
std::deque< OUString > mParaOUStrings
void SetIsLosslessCompression(const bool bLosslessCompression)
void SetIsExportTaggedPDF(const bool bTaggedPDF)
void Push(PushFlags nFlags=PushFlags::ALL)
Definition: pdfwriter.cxx:226
std::deque< PDFExtOutDevDataSync > mActions
void SetMapMode(const MapMode &rNewMapMode)
Definition: pdfwriter.cxx:236
GfxLink GetGfxLink() const
Definition: graph.cxx:503
sal_Int32 BeginStructureElement(PDFWriter::StructElement eType, const OUString &rAlias=OUString())
begin a new logical structure element
sal_Int32 CreateScreen(const tools::Rectangle &rRect, sal_Int32 nPageNr)
Create a Screen annotation.
sal_Int32 RegisterDestReference(sal_Int32 nDestId, const tools::Rectangle &rRect, sal_Int32 nPageNr, DestAreaType eType)
creates a destination which is not intended to be referred to by a link, but by a public destination ...
Definition: pdfwriter.cxx:341
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
void DescribeRegisteredDest(sal_Int32 nDestId, const tools::Rectangle &rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType=PDFWriter::DestAreaType::XYZ)
provides detailed information about a destination range which previously has been registered using Re...
bool HasAdequateCompression(const Graphic &rGraphic, const tools::Rectangle &rOutputRect, const tools::Rectangle &rVisibleOutputRect) const
Detect if stream is compressed enough to avoid de-compress / scale & re-compress. ...
void SetLinkURL(sal_Int32 nLinkId, const OUString &rURL)
Set the URL for a link.
std::vector< sal_Int32 > mStructIdMap
void CreateNote(const tools::Rectangle &rRect, const PDFNote &rNote, sal_Int32 nPageNr=-1)
Create a new note on a page.
::std::map< sal_Int32, PDFLinkDestination > mFutureDestinations
sal_Int32 CreateControl(const AnyWidget &rControlType)
create a new form control
Definition: pdfwriter.cxx:435
sal_Int32 CreateOutlineItem(sal_Int32 nParent, const OUString &rText, sal_Int32 nDestID)
Create a new outline item.
Definition: pdfwriter.cxx:380
css::lang::Locale maDocLocale
std::unique_ptr< PageSyncData > mpPageSyncData
void PlayGlobalActions(PDFWriter &rWriter)
void SetStructureAttribute(enum StructAttribute eAttr, enum StructAttributeValue eVal)
set a structure attribute on the current structural element
Definition: pdfwriter.cxx:405
sal_Int32 CreateLink(const tools::Rectangle &rRect, sal_Int32 nPageNr)
Create a new link on a page.
Definition: pdfwriter.cxx:331
#define SAL_WARN_IF(condition, area, stream)
OutputDevice & mrOutDev
void SetScreenURL(sal_Int32 nScreenId, const OUString &rURL)
Sets the URL of a linked screen annotation.
Definition: pdfwriter.cxx:365
unsigned char sal_uInt8
MetaAction * GetAction(size_t nAction) const
Definition: gdimtf.cxx:187
void SetLinkURL(sal_Int32 nLinkId, const OUString &rURL)
Set the URL for a link will change a dest type link to a URL type link if necessary.
Definition: pdfwriter.cxx:360
sal_Int32 CreateNamedDest(const OUString &sDestName, const tools::Rectangle &rRect, sal_Int32 nPageNr=-1)
Create a new named destination to be used in a link to this document from another PDF document (see P...
sal_Int32 CreateLink(const tools::Rectangle &rRect, sal_Int32 nPageNr=-1)
Create a new link on a page.
bool PlaySyncPageAct(PDFWriter &rWriter, sal_uInt32 &rCurGDIMtfAction, const GDIMetaFile &rMtf, const PDFExtOutDevData &rOutDevData)
size_t GetActionSize() const
Definition: gdimtf.cxx:182
void SetDocumentLocale(const css::lang::Locale &rLoc)
MetaActionType GetType() const
Definition: metaact.hxx:90
std::deque< tools::Rectangle > mParaRects
sal_Int32 CreateOutlineItem(sal_Int32 nParent, const OUString &rText, sal_Int32 nDestID)
Create a new outline item.
sal_Int32 CreateDest(const tools::Rectangle &rRect, sal_Int32 nPageNr, DestAreaType eType)
Create a new destination to be used in a link.
Definition: pdfwriter.cxx:350
void SetActualText(const OUString &rText)
set the ActualText attribute of a structural element
void CreateNote(const tools::Rectangle &rRect, const PDFNote &rNote, sal_Int32 nPageNr)
Create a new note on a page.
Definition: pdfwriter.cxx:385
const OutputDevice & mrOutDev
void SetIsExportTransitionEffects(const bool bTransitionalEffects)
sal_Int32 GetMappedStructId(sal_Int32)
const Graphic & GetCurrentGraphic() const
void CreateControl(const PDFWriter::AnyWidget &rControlType)
create a new form control
sal_Int32 CreateScreen(const tools::Rectangle &rRect, sal_Int32 nPageNr)
Creates a screen annotation.
Definition: pdfwriter.cxx:336
void SetScreenStream(sal_Int32 nScreenId, const OUString &rURL)
Set URL for an embedded Screen annotation.
void SetPageTransition(PDFWriter::PageTransition eType, sal_uInt32 nMilliSec)
Sets the transitional effect to be applied when the current page gets shown.
void SetScreenStream(sal_Int32 nScreenId, const OUString &rURL)
Sets the URL of an embedded screen annotation.
Definition: pdfwriter.cxx:370
void SetClipRegion()
Definition: pdfwriter.cxx:251
std::deque< MapMode > mParaMapModes
void SetStructureBoundingBox(const tools::Rectangle &rRect)
set the bounding box of a structural element
void EndStructureElement()
end a logical structure element
std::deque< PDFWriter::PageTransition > mParaPageTransitions
bool GetIsReduceImageResolution() const
void SetCurrentStructureElement(sal_Int32 nElement)
set the current structure element
Definition: pdfwriter.cxx:400