1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
15 #include <rtl/strbuf.hxx>
16 #include <rtl/string.hxx>
17 #include <sal/types.h>
18 #include <vcl/dllapi.h>
24 class PDFObjectContainer
;
27 class PDFObjectElement
;
31 /// Copies objects from one PDF file into another one.
34 PDFObjectContainer
& m_rContainer
;
36 void copyRecursively(OStringBuffer
& rLine
, filter::PDFElement
* pInputElement
,
37 SvMemoryStream
& rDocBuffer
,
38 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
41 PDFObjectCopier(PDFObjectContainer
& rContainer
);
43 /// Copies resources of a given kind from an external page to the output,
44 /// returning what has to be included in the new resource dictionary.
45 OString
copyExternalResources(filter::PDFObjectElement
& rPage
, const OString
& rKind
,
46 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
48 /// Copies a single resource from an external document, returns the new
49 /// object ID in our document.
50 sal_Int32
copyExternalResource(SvMemoryStream
& rDocBuffer
, filter::PDFObjectElement
& rObject
,
51 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
53 /// Copies resources of pPage into rLine.
54 void copyPageResources(filter::PDFObjectElement
* pPage
, OStringBuffer
& rLine
);
56 void copyPageResources(filter::PDFObjectElement
* pPage
, OStringBuffer
& rLine
,
57 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
59 /// Copies page one or more page streams from rContentStreams into rStream.
60 static sal_Int32
copyPageStreams(std::vector
<filter::PDFObjectElement
*>& rContentStreams
,
61 SvMemoryStream
& rStream
, bool& rCompressed
);
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */