31 if (aFirstBytes[0] !=
'%' || aFirstBytes[1] !=
'P' || aFirstBytes[2] !=
'D'
32 || aFirstBytes[3] !=
'F' || aFirstBytes[4] !=
'-')
35 sal_Int32 nMajor =
o3tl::toInt32(std::string_view(
reinterpret_cast<char*
>(&aFirstBytes[5]), 1));
36 sal_Int32 nMinor =
o3tl::toInt32(std::string_view(
reinterpret_cast<char*
>(&aFirstBytes[7]), 1));
37 return !(nMajor > 1 || (nMajor == 1 && nMinor > 6));
60 std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
61 = pPdfium->openDocument(aInBuffer.
GetData(), aInBuffer.
GetSize(), OString());
66 if (!pPdfDocument->saveWithVersion(aSaved, 16))
73 return rOutStream.
good();
90 return rOutStream.
good();
100 const sal_uInt32 nStreamLength = aMemoryStream.
TellEnd();
Container for the binary data, whose responsibility is to manage the make it as simple as possible to...
virtual sal_uInt64 TellEnd() override
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
SvStream & WriteStream(SvStream &rStream)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
bool convertToHighestSupported(SvStream &rInStream, SvStream &rOutStream)
Converts to highest supported format version (1.6).
BinaryDataContainer createBinaryDataContainer(SvStream &rStream)
bool isCompatible(SvStream &rInStream, sal_uInt64 nPos, sal_uInt64 nSize)
Decide if PDF data is old enough to be compatible.
bool getCompatibleStream(SvStream &rInStream, SvStream &rOutStream)
Takes care of transparently downgrading the version of the PDF stream in case it's too new for our PD...
#define STREAM_SEEK_TO_END
#define STREAM_SEEK_TO_BEGIN
static std::shared_ptr< PDFium > & get()