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>
23 class PDFObjectContainer
;
26 class PDFObjectElement
;
30 /// Copies objects from one PDF file into another one.
33 PDFObjectContainer
& m_rContainer
;
35 void copyRecursively(OStringBuffer
& rLine
, filter::PDFElement
& rInputElement
,
36 SvMemoryStream
& rDocBuffer
,
37 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
40 PDFObjectCopier(PDFObjectContainer
& rContainer
);
42 /// Copies resources of a given kind from an external page to the output,
43 /// returning what has to be included in the new resource dictionary.
44 OString
copyExternalResources(filter::PDFObjectElement
& rPage
, const OString
& rKind
,
45 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
47 /// Copies a single resource from an external document, returns the new
48 /// object ID in our document.
49 sal_Int32
copyExternalResource(SvMemoryStream
& rDocBuffer
, filter::PDFObjectElement
& rObject
,
50 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
52 /// Copies resources of pPage into rLine.
53 void copyPageResources(filter::PDFObjectElement
* pPage
, OStringBuffer
& rLine
);
55 void copyPageResources(filter::PDFObjectElement
* pPage
, OStringBuffer
& rLine
,
56 std::map
<sal_Int32
, sal_Int32
>& rCopiedResources
);
58 /// Copies page one or more page streams from rContentStreams into rStream.
59 static sal_Int32
copyPageStreams(std::vector
<filter::PDFObjectElement
*>& rContentStreams
,
60 SvMemoryStream
& rStream
, bool& rCompressed
);
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */