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