diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-01-23 12:33:39 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-24 10:50:49 +0000 |
commit | e052f6e1d49a5289411b31561d6e310bf414d896 (patch) | |
tree | 8aa7d8683589077346abe32b4a6c8e6d0d777ae8 /include | |
parent | 217ef2ed9b8a757b7b02feac799621d20d0f312e (diff) |
tdf#66580 write ODF document as an attachment in hybrid mode
This changes the hybrid mode so that the ODF document is written
as an PDF compatible file attachment into the PDF document. It also
keeps writing the /AdditionalStreams element into the trailer to
keep backwards compatibility for now.
Change-Id: Ica31159cfbd591c6741e3da62c42d1fefd085696
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146053
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/pdfwriter.hxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index f98f2c231261..80b71237138e 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -1193,24 +1193,24 @@ The following structure describes the permissions used in PDF security */ sal_Int32 CreateControl( const AnyWidget& rControlType ); - /** Inserts an additional stream to the PDF file + /** Attaches an additional file to the PDF file - This function adds an arbitrary stream to the produced PDF file. May be called - any time before Emit(). The stream will be written during - Emit by calling the PDFOutputStream Object's write - method. After the call the PDFOutputStream will be deleted. + This function adds an arbitrary stream that represents an attached file + in the PDF file. - All additional streams and their mimetypes will be entered into an array - in the trailer dictionary. + This also adds an additional stream array entry (with the mimetype) in + the trailer dictionary for backwards compatibility. + + @param rFileName + the filename of the additional file as presented in the stream @param rMimeType the mimetype of the stream @param pStream the interface to the additional stream - */ - void AddStream( const OUString& rMimeType, PDFOutputStream* pStream ); + void AddAttachedFile(OUString const& rFileName, const OUString& rMimeType, std::unique_ptr<PDFOutputStream> pStream); /// Write rString as a PDF hex string into rBuffer. static void AppendUnicodeTextString(const OUString& rString, OStringBuffer& rBuffer); |