40#include <com/sun/star/beans/PropertyValue.hpp>
41#include <com/sun/star/io/XSeekable.hpp>
42#include <com/sun/star/graphic/GraphicProvider.hpp>
43#include <com/sun/star/graphic/XGraphicProvider.hpp>
44#include <com/sun/star/beans/XMaterialHolder.hpp>
69 playMetafile( aTmpMtf,
nullptr, i_rContext, i_pDummyVDev );
80 Point aPoint( i_rPoint );
81 Size aSize( i_rSize );
87 if( aSize.
Width() < 0 )
90 aPoint.AdjustX( -(aSize.
Width()) );
96 aPoint.AdjustY( -(aSize.
Height()) );
102 aBitmapEx.
Mirror( nMirrorFlags );
105 bool bIsJpeg =
false, bIsPng =
false;
120 const double fBmpPixelX = aBmpSize.
Width();
121 const double fBmpPixelY = aBmpSize.
Height();
122 const double fMaxPixelX
125 const double fMaxPixelY
130 if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
131 ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
132 ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
136 const double fBmpWH = fBmpPixelX / fBmpPixelY;
137 const double fMaxWH = fMaxPixelX / fMaxPixelY;
139 if( fBmpWH < fMaxWH )
144 else if( fBmpWH > 0.0 )
163 if ( !(aSizePixel.
Width() && aSizePixel.
Height()) )
169 if ( bIsPng || ( aSizePixel.
Width() < 32 ) || ( aSizePixel.
Height() < 32 ) )
170 bUseJPGCompression =
false;
172 auto pStrm=std::make_shared<SvMemoryStream>();
175 bool bTrueColorJPG =
true;
176 if ( bUseJPGCompression )
191 sal_uInt32 nZippedFileSize = 0;
198 nZippedFileSize = aTemp.
TellEnd();
212 uno::Reference< io::XSeekable > xSeekable(
xStream, UNO_QUERY_THROW );
214 uno::Reference< graphic::XGraphicProvider > xGraphicProvider( graphic::GraphicProvider::create(xContext) );
215 uno::Reference< graphic::XGraphic > xGraphic( aGraphic.
GetXGraphic() );
216 uno::Reference < io::XOutputStream > xOut(
xStream->getOutputStream() );
217 uno::Sequence< beans::PropertyValue > aOutMediaProperties{
222 xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties );
224 if ( !bIsJpeg && xSeekable->getLength() > nZippedFileSize )
226 bUseJPGCompression =
false;
232 xSeekable->seek( 0 );
235 uno::Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
238 sal_Int16 nBitsPerPixel = 24;
239 if ( xPropSet->getPropertyValue(
"BitsPerPixel") >>= nBitsPerPixel )
241 bTrueColorJPG = nBitsPerPixel != 8;
246 catch( uno::Exception& )
248 bUseJPGCompression =
false;
251 if ( bUseJPGCompression )
254 if (!aBitmapEx.
IsAlpha() && bTrueColorJPG)
261 else if ( aBitmapEx.
IsAlpha() )
270 bool bAssertionFired(
false );
276 pDummyVDev = xPrivateDevice.
get();
436 const sal_uInt16 nTransPercent = aTransCol.
GetLuminance() * 100 / 255;
441 if (rPos != aMtfOrigin)
442 aTmpMtf.
Move(rPos.X() - aMtfOrigin.X(), rPos.Y() - aMtfOrigin.Y());
444 playMetafile( aTmpMtf,
nullptr, i_rContext, pDummyVDev );
453 sal_Int32 nMaxBmpDPI(300);
462 if ( nPixelX && nPixelY )
464 Size aDstSizePixel( nPixelX, nPixelY );
466 if( xVDev->SetOutputSizePixel( aDstSizePixel ) )
474 xVDev->SetMapMode( aMapMode );
475 Size aDstSize( xVDev->PixelToLogic( aDstSizePixel ) );
478 if ( aMtfOrigin.X() || aMtfOrigin.Y() )
479 aTmpMtf.
Move( -aMtfOrigin.X(), -aMtfOrigin.Y() );
480 double fScaleX =
static_cast<double>(aDstSize.
Width()) /
static_cast<double>(aTmpMtf.
GetPrefSize().
Width());
482 if( fScaleX != 1.0 || fScaleY != 1.0 )
483 aTmpMtf.
Scale( fScaleX, fScaleY );
488 aTmpMtf.
Play(*xVDev, aPoint, aDstSize);
491 xVDev->EnableMapMode(
false );
492 aPaint = xVDev->GetBitmap( aPoint, aDstSizePixel );
493 xVDev->EnableMapMode();
502 aTmpMtf.
Play(*xVDev, aPoint, aDstSize);
504 xVDev->EnableMapMode(
false );
505 aMask = xVDev->GetBitmap( aPoint, aDstSizePixel );
506 xVDev->EnableMapMode();
510 xVDev->DrawGradient(
tools::Rectangle( aPoint, aDstSize ), rTransparenceGradient );
512 xVDev->EnableMapMode(
false );
513 xVDev->DrawMask( aPoint, aDstSizePixel, aMask,
COL_WHITE );
514 aAlpha = xVDev->GetBitmap( aPoint, aDstSizePixel );
540 playMetafile( aSubstitute,
nullptr, i_rContext, pDummyVDev );
551 if( pA->
GetComment().equalsIgnoreAsciiCase(
"XGRAD_SEQ_BEGIN"))
556 while( !bDone && ( ++
i <
nCount ) )
563 (
static_cast<const MetaCommentAction*
>(pAction)->GetComment().equalsIgnoreAsciiCase(
"XGRAD_SEQ_END")) )
587 bool bSkipSequence =
false;
590 if( pA->
GetComment() ==
"XPATHSTROKE_SEQ_BEGIN" )
592 sSeqEnd = OString(
"XPATHSTROKE_SEQ_END");
609 bSkipSequence =
true;
610 if ( aStartArrow.
Count() || aEndArrow.
Count() )
611 bSkipSequence =
false;
612 if ( !aDashArray.empty() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) )
613 bSkipSequence =
false;
641 && fStrokeWidth > 0.0)
644 const sal_uInt16 nPoints(aPath.
GetSize());
645 const bool bCurve(aPath.
HasFlags());
647 for(sal_uInt16
a(0);
a + 1 < nPoints;
a++)
650 && PolyFlags::Normal != aPath.
GetFlags(
a + 1)
652 && PolyFlags::Normal != aPath.
GetFlags(
a + 2)
675 else if ( pA->
GetComment() ==
"XPATHFILL_SEQ_BEGIN" )
677 sSeqEnd = OString(
"XPATHFILL_SEQ_END");
684 if ( fTransparency == 0.0 )
689 bSkipSequence =
true;
692 else if ( fTransparency == 1.0 )
693 bSkipSequence =
true;
703 OString sComment(
static_cast<const MetaCommentAction*
>(pAction)->GetComment() );
704 if (sComment == sSeqEnd)
791 SAL_WARN(
"vcl",
"MetaMask...Action not supported yet" );
1008 if( !bAssertionFired )
1010 bAssertionFired =
true;
1011 SAL_WARN(
"vcl",
"PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered " <<
static_cast<int>(
nType) );
1040 maID =
reinterpret_cast< sal_IntPtr
>(
this);
1041 while( sTransporters.find( maID ) != sTransporters.end() )
1043 sTransporters[ maID ] =
this;
1048 sTransporters.erase( maID );
1049 SAL_INFO(
"vcl",
"EncHashTransporter freed" );
1062 return uno::Any( sal_Int64(maID) );
1065 static EncHashTransporter* getEncHashTransporter(
const uno::Reference< beans::XMaterialHolder >& );
1076 uno::Any aMat( xRef->getMaterial() );
1080 std::map< sal_IntPtr, EncHashTransporter* >::iterator it = sTransporters.find(
static_cast<sal_IntPtr
>(nMat) );
1081 if( it != sTransporters.end() )
1082 pResult = it->second;
1132 const OUString& i_rUserPassword
1135 uno::Reference< beans::XMaterialHolder > xResult;
1136 if( !i_rOwnerPassword.isEmpty() || !i_rUserPassword.isEmpty() )
1139 xResult = pTransporter;
1143 padPassword( i_rOwnerPassword.isEmpty() ? i_rUserPassword : i_rOwnerPassword, aPadOPW );
1154 rtl_secureZeroMemory (aPadOPW,
sizeof(aPadOPW));
1155 rtl_secureZeroMemory (aPadUPW,
sizeof(aPadUPW));
1162 bool bSuccess =
false;
1166 sal_Int32 nKeyLength = 0, nRC4KeyLength = 0;
1181 sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength )
1190 sal_Int32 nAccessPermissions = 0xfffff0c0;
1193 o_rRC4KeyLength = 16;
1199 nAccessPermissions |= ( i_rProperties.
CanAddOrModify ) ? 1 << 5 : 0;
1202 nAccessPermissions |= ( i_rProperties.
CanAssemble ) ? 1 << 10 : 0;
1203 nAccessPermissions |= ( i_rProperties.
CanPrintFull ) ? 1 << 11 : 0;
1204 return nAccessPermissions;
1219 sal_Int32 nCurrentChar;
1221 for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
1222 o_pPaddedPW[nCurrentChar] =
static_cast<sal_uInt8>( aString[nCurrentChar] );
1242 bool bSuccess =
true;
1243 ::std::vector<unsigned char> nMD5Sum;
1250 if( ! io_rProperties.
OValue.empty() )
1257 nPerm[0] =
static_cast<sal_uInt8>(i_nAccessPermissions);
1258 nPerm[1] =
static_cast<sal_uInt8>( i_nAccessPermissions >> 8 );
1259 nPerm[2] =
static_cast<sal_uInt8>( i_nAccessPermissions >> 16 );
1260 nPerm[3] =
static_cast<sal_uInt8>( i_nAccessPermissions >> 24 );
1262 pDigest->
update(nPerm,
sizeof(nPerm));
1270 for (sal_Int32
i = 0;
i < 50;
i++)
1299 std::vector< sal_uInt8 >& io_rOValue,
1300 sal_Int32 i_nKeyLength
1303 bool bSuccess =
true;
1307 rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
1319 for (
i = 0;
i < 50;
i++)
1327 if (rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1328 nMD5Sum.data(), i_nKeyLength ,
nullptr, 0 )
1329 == rtl_Cipher_E_None)
1333 io_rOValue.data(), sal_Int32(io_rOValue.size()) );
1341 for(
i = 1;
i <= 19;
i++ )
1343 for(
y = 0;
y <
sizeof( nLocalKey );
y++ )
1344 nLocalKey[
y] =
static_cast<sal_uInt8>( nMD5Sum[
y] ^
i );
1346 if (rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1348 != rtl_Cipher_E_None)
1353 rtl_cipher_encodeARCFOUR( aCipher, io_rOValue.data(), sal_Int32(io_rOValue.size()),
1354 io_rOValue.data(), sal_Int32(io_rOValue.size()) );
1366 rtl_cipher_destroyARCFOUR( aCipher );
1378 sal_Int32 i_nKeyLength,
1379 sal_Int32 i_nAccessPermissions
1382 bool bSuccess =
true;
1387 rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
1394 for( sal_Int32
i = i_nKeyLength,
y = 0;
y < 5 ;
y++ )
1405 ::std::vector<unsigned char>
const nMD5Sum(aDigest.
finalize());
1407 rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1409 rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum.data(), nMD5Sum.size(),
1416 for(
i = 1;
i <= 19;
i++ )
1418 for(
y = 0;
y <
sizeof( nLocalKey ) ;
y++ )
1421 rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1435 rtl_cipher_destroyARCFOUR( aCipher );
1438 io_rProperties.
UValue.clear();
1446 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
1447 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1454 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1455 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1457 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1458 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1459 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1460 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1461 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1467 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1468 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1469 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1472 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1473 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1475 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1480 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1481 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8,
1486 return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0;
1502 while( nBitInByte != 8 )
1504 if( (nByte & nMask) != (i_bSet ? nMask : 0) )
1505 return std::min(
nIndex, i_nW);
1532 while( nByte == nRunByte )
1546 nIndex += pRunTable[nByte];
1549 return std::min(
nIndex, i_nW);
1554 if (i_nStartIndex < 0)
1562 if (i_nStartIndex < 0)
1565 const bool bSet = i_nStartIndex < i_nW &&
isSet(i_pLine, i_nStartIndex);
1582 void flush() { mnNextBitPos = 8; mnBuffer = 0; }
1594 assert(i_nLength < 9);
1595 static const unsigned int msbmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
1609 sal_uInt32 mnEncodedPixels;
1610 sal_uInt32 mnCodeBits;
1836 while( i_nSpan > 2623 )
1839 putG4Bits( pTable[103].mnCodeBits, pTable[103].mnCode, io_rState );
1840 i_nSpan -= pTable[103].mnEncodedPixels;
1845 sal_uInt32 nTabIndex = 63 + (i_nSpan >> 6);
1846 OSL_ASSERT( pTable[nTabIndex].mnEncodedPixels ==
static_cast<sal_uInt32
>(64*(i_nSpan >> 6)) );
1847 putG4Bits( pTable[nTabIndex].mnCodeBits, pTable[nTabIndex].mnCode, io_rState );
1848 i_nSpan -= pTable[nTabIndex].mnEncodedPixels;
1850 putG4Bits( pTable[i_nSpan].mnCodeBits, pTable[i_nSpan].mnCode, io_rState );
1857 if( nW <= 0 || nH <= 0 )
1865 std::unique_ptr<sal_uInt8[]> pFirstRefLine(
new sal_uInt8[nW/8 + 1]);
1866 memset(pFirstRefLine.get(), 0, nW/8 + 1);
1867 Scanline pRefLine = pFirstRefLine.get();
1872 bool bRunSet = (*pCurLine & 0x80) != 0;
1873 bool bRefSet = (*pRefLine & 0x80) != 0;
1876 for( ; nLineIndex < nW; )
1879 if( nRefIndex2 >= nRunIndex1 )
1882 if( -3 <= nDiff && nDiff <= 3 )
1886 sal_uInt32 mnCodeBits;
1888 } VerticalCodes[7] = {
1901 putG4Bits( VerticalCodes[nDiff].mnCodeBits, VerticalCodes[nDiff].mnCode, aBitState );
1902 nLineIndex = nRunIndex1;
1909 bool bWhiteFirst = ( nLineIndex + nRunIndex1 == 0 || !
isSet( pCurLine, nLineIndex ) );
1910 putG4Span( nRunIndex1 - nLineIndex, bWhiteFirst, aBitState );
1911 putG4Span( nRunIndex2 - nRunIndex1, ! bWhiteFirst, aBitState );
1912 nLineIndex = nRunIndex2;
1918 nLineIndex = nRefIndex2;
1920 if( nLineIndex < nW )
1922 bool bSet =
isSet( pCurLine, nLineIndex );
1923 nRunIndex1 =
findBitRun( pCurLine, nLineIndex, nW, bSet );
1924 nRefIndex1 =
findBitRun( pRefLine, nLineIndex, nW, ! bSet );
1925 nRefIndex1 =
findBitRun( pRefLine, nRefIndex1, nW, bSet );
1930 pRefLine = pCurLine;
1950 case css::awt::GradientStyle_LINEAR:
1951 case css::awt::GradientStyle_AXIAL:
const AlphaMask & GetAlphaMask() const
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
bool Convert(BmpConversion eConversion)
Convert bitmap format.
BitmapChecksum GetChecksum() const
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
Bitmap GetBitmap(Color aTransparentReplaceColor) const
const MapMode & GetPrefMapMode() const
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
const Size & GetPrefSize() const
const Size & GetSizePixel() const
tools::Long Height() const
tools::Long Width() const
sal_uInt16 GetBitCount() const
Scanline GetScanline(tools::Long nY) const
sal_uInt8 GetLuminance() const
static std::map< sal_IntPtr, EncHashTransporter * > sTransporters
virtual uno::Any SAL_CALL getMaterial() override
std::vector< sal_uInt8 > maOValue
virtual ~EncHashTransporter() override
::std::unique_ptr<::comphelper::Hash > m_pDigest
static EncHashTransporter * getEncHashTransporter(const uno::Reference< beans::XMaterialHolder > &)
std::vector< sal_uInt8 > & getOValue()
::comphelper::Hash * getUDigest()
GfxLinkType GetType() const
void AddGradientActions(tools::Rectangle const &rRect, GDIMetaFile &rMetaFile)
const Color & GetEndColor() const
const Color & GetStartColor() const
css::awt::GradientStyle GetStyle() const
sal_uInt16 GetSteps() const
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
GraphicType GetType() const
GfxLink GetGfxLink() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
const Point & GetOrigin() const
void SetScaleX(const Fraction &rScaleX)
sal_uInt32 GetWidth() const
sal_Int32 GetIndex() const
const OUString & GetText() const
const Point & GetPoint() const
const Point & GetPoint() const
const OUString & GetText() const
sal_Int32 GetIndex() const
TextAlign GetTextAlign() const
sal_Int32 GetIndex() const
const KernArray & GetDXArray() const
const OUString & GetText() const
const Point & GetPoint() const
const std::vector< sal_Bool > & GetKashidaArray() const
const Color & GetColor() const
const Color & GetColor() const
LanguageType GetTextLanguage() const
const Point & GetStartPoint() const
tools::Long GetWidth() const
FontLineStyle GetUnderline() const
FontLineStyle GetOverline() const
FontStrikeout GetStrikeout() const
const Color & GetColor() const
DrawTextFlags GetStyle() const
const tools::Rectangle & GetRect() const
const OUString & GetText() const
void EnableOutput(bool bEnable=true)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void ReleaseFontCollection()
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
virtual void ImplClearFontData(bool bNewFontLists)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void SetFontCollectionFromSVData()
void disposeAndReset(reference_type *pBody)
Assignment that releases the last reference.
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
virtual sal_uInt64 TellEnd() override
void SetCompressMode(SvStreamCompressFlags nNewMode)
SvStreamCompressFlags GetCompressMode() const
void SetVersion(sal_Int32 n)
Encapsulates geometry and associated attributes of a filled area.
FillRule getFillRule() const
Get fill rule used.
@ fillEvenOdd
Even-odd fill rule.
double getTransparency() const
Get stroke transparency.
FillType getFillType() const
Get fill type used.
void getPath(tools::PolyPolygon &) const
Query path to fill.
@ fillSolid
Fill with a specified solid color.
Encapsulates geometry and associated attributes of a graphical 'pen stroke'.
double getMiterLimit() const
Get the maximum length of mitered joins.
void getPath(tools::Polygon &) const
Query path to stroke.
void getStartArrow(tools::PolyPolygon &) const
Get the polygon that is put at the start of the line.
JoinType getJoinType() const
Get the style in which the stroke segments are joined.
void getEndArrow(tools::PolyPolygon &) const
Get the polygon that is put at the end of the line.
void getDashArray(DashArray &) const
Get an array of "on" and "off" lengths for stroke dashing.
@ capRound
Half-round cap at the line end, the center lying at the end point.
@ capButt
No additional cap.
@ capSquare
Half-square cap at the line end, the center lying at the end point.
double getTransparency() const
Get stroke transparency.
CapType getCapType() const
Get the style in which open stroke ends are drawn.
double getStrokeWidth() const
Get width of the stroke.
::std::vector< double > DashArray
@ joinBevel
Connect segments by a direct straight line.
@ joinNone
Perform no join, leads to visible gaps between thick line segments.
@ joinRound
Connect segments by a filled round arc.
@ joinMiter
Extend segment edges, until they cross.
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
reference_type * get() const
Get the body.
virtual bool AcquireGraphics() const override
Acquire a graphics device that the output device uses to draw on.
std::vector< unsigned char > finalize()
static std::vector< unsigned char > calculateHash(const unsigned char *pInput, size_t length, HashType eType)
void update(const unsigned char *pInput, size_t length)
void insert(key_value_pair_t &rPair)
list_const_iterator_t end() const
list_const_iterator_t find(const Key &key)
bool PlaySyncPageAct(PDFWriter &rWriter, sal_uInt32 &rCurGDIMtfAction, const GDIMetaFile &rMtf)
const Graphic & GetCurrentGraphic() const
static bool computeODictionaryValue(const sal_uInt8 *i_pPaddedOwnerPassword, const sal_uInt8 *i_pPaddedUserPassword, std::vector< sal_uInt8 > &io_rOValue, sal_Int32 i_nKeyLength)
void putG4Bits(sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState &io_rState)
void enableStringEncryption(sal_Int32 nObject)
void ImplRefreshFontData(bool bNewFontLists) override
static css::uno::Reference< css::beans::XMaterialHolder > initEncryption(const OUString &i_rOwnerPassword, const OUString &i_rUserPassword)
static void padPassword(std::u16string_view i_rPassword, sal_uInt8 *o_pPaddedPW)
sal_Int32 m_nRC4KeyLength
static sal_Int32 computeAccessPermissions(const vcl::PDFWriter::PDFEncryptionProperties &i_rProperties, sal_Int32 &o_rKeyLength, sal_Int32 &o_rRC4KeyLength)
static bool computeEncryptionKey(EncHashTransporter *, vcl::PDFWriter::PDFEncryptionProperties &io_rProperties, sal_Int32 i_nAccessPermissions)
void DrawHatchLine_DrawLine(const Point &rStartPoint, const Point &rEndPoint) override
void writeG4Stream(BitmapReadAccess const *i_pBitmap)
PDFWriter::PDFWriterContext m_aContext
void checkAndEnableStreamEncryption(sal_Int32 nObject) override
void ImplClearFontData(bool bNewFontLists) override
bool m_bEncryptThisStream
bool writeBufferBytes(const void *pBuffer, sal_uInt64 nBytes) override
See vcl::PDFObjectContainer::writeBuffer().
o3tl::lru_map< BitmapChecksum, std::shared_ptr< SvMemoryStream > > m_aPDFBmpCache
Cache some most recent bitmaps we've exported, in case we encounter them again..
void playMetafile(const GDIMetaFile &, vcl::PDFExtOutDevData *, const vcl::PDFWriter::PlayMetafileContext &, VirtualDevice *pDummyDev=nullptr)
void implWriteGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient, VirtualDevice *pDummyVDev, const vcl::PDFWriter::PlayMetafileContext &)
void drawLine(const Point &rStart, const Point &rStop)
void putG4Span(tools::Long i_nSpan, bool i_bWhitePixel, BitStreamState &io_rState)
bool prepareEncryption(const css::uno::Reference< css::beans::XMaterialHolder > &)
vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override
Perform actual rect clip against outdev dimensions, to generate empty clips whenever one of the value...
void implWriteBitmapEx(const Point &rPoint, const Size &rSize, const BitmapEx &rBitmapEx, const Graphic &i_pGraphic, VirtualDevice const *pDummyVDev, const vcl::PDFWriter::PlayMetafileContext &)
static bool computeUDictionaryValue(EncHashTransporter *i_pTransporter, vcl::PDFWriter::PDFEncryptionProperties &io_rProperties, sal_Int32 i_nKeyLength, sal_Int32 i_nAccessPermissions)
static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE]
void DrawPolygon(const tools::Polygon &rPoly)
void DrawEllipse(const tools::Rectangle &rRect)
void SetFillColor(const Color &rColor)
void DrawPie(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
void DrawChord(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
void SetFont(const vcl::Font &rNewFont)
void DrawHatch(const tools::PolyPolygon &rPolyPoly, const Hatch &rHatch)
void SetTextAlign(::TextAlign eAlign)
void SetTextColor(const Color &rColor)
void DrawTextLine(const Point &rPos, tools::Long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline)
void DrawStretchText(const Point &rStartPt, sal_Int32 nWidth, const OUString &rStr, sal_Int32 nIndex, sal_Int32 nLen)
void Push(PushFlags nFlags=PushFlags::ALL)
void DrawPolyLine(const tools::Polygon &rPoly)
void SetDigitLanguage(LanguageType eLang)
void BeginTransparencyGroup()
Start a transparency group.
void DrawTextArray(const Point &rStartPt, const OUString &rStr, KernArraySpan aKernArray, o3tl::span< const sal_Bool > pKashidaAry, sal_Int32 nIndex, sal_Int32 nLen)
void DrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
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)
void DrawText(const Point &rPos, const OUString &rText)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void IntersectClipRegion(const tools::Rectangle &rRect)
void DrawPixel(const Point &rPt, const Color &rColor)
void DrawBitmapEx(const Point &rDestPt, const Size &rDestSize, const BitmapEx &rBitmapEx)
void SetMapMode(const MapMode &rNewMapMode)
void DrawRect(const tools::Rectangle &rRect)
void SetLineColor(const Color &rColor)
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nMode)
void EndTransparencyGroup(const tools::Rectangle &rBoundRect, sal_uInt16 nTransparencePercent)
End a transparency group with constant transparency factor.
void DrawBitmap(const Point &rDestPt, const Size &rDestSize, const Bitmap &rBitmap, const Graphic &rGraphic)
void DrawGradient(const tools::Rectangle &rRect, const Gradient &rGradient)
void MoveClipRegion(tools::Long nHorzMove, tools::Long nVertMove)
void DrawPolyPolygon(const tools::PolyPolygon &rPolyPoly)
void DrawArc(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
void DrawWallpaper(const tools::Rectangle &rRect, const Wallpaper &rWallpaper)
basegfx::B2DPolyPolygon GetAsB2DPolyPolygon() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
GfxLinkType
GfxLink graphic types that are supported by GfxLink.
tools::Long FRound(double fVal)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
Reference< XComponentContext > getProcessComponentContext()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const PixelCode WhitePixelCodes[]
const PixelCode BlackPixelCodes[]
static bool lcl_canUsePDFAxialShading(const Gradient &rGradient)
static tools::Long findBitRun(const Scanline i_pLine, tools::Long i_nStartIndex, tools::Long i_nW, bool i_bSet)
static tools::Long findBitRunImpl(const Scanline i_pLine, tools::Long i_nStartIndex, tools::Long i_nW, bool i_bSet)
const tools::Long setRun[256]
const tools::Long unsetRun[256]
static bool isSet(const Scanline i_pLine, tools::Long i_nIndex)
constexpr sal_Int32 MAXIMUM_RC4_KEY_LENGTH
constexpr sal_Int32 MD5_DIGEST_SIZE
constexpr sal_Int32 ENCRYPTED_PWD_SIZE
constexpr sal_Int32 SECUR_128BIT_KEY
#define STREAM_SEEK_TO_END
const sal_uInt8 & getByte() const
std::vector< double > m_aDashArray
std::vector< sal_uInt8 > UValue
std::vector< sal_uInt8 > DocumentIdentifier
std::vector< sal_uInt8 > EncryptionKey
std::vector< sal_uInt8 > OValue
bool CanExtractForAccessibility
PDFWriter::PDFEncryptionProperties Encryption
PDFWriter::ColorMode ColorMode
Play a metafile like an outputdevice would do.
int m_nMaxImageResolution
bool m_bTransparenciesWereRemoved
bool m_bOnlyLosslessCompression