tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / vcl / inc / pdf / pdfcompat.hxx
blob0664a400f90e9e62b446913bb99d208cc14cd16d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #pragma once
12 #include <o3tl/unit_conversion.hxx>
13 #include <tools/stream.hxx>
14 #include <vcl/BinaryDataContainer.hxx>
16 namespace vcl::pdf
18 /// Convert to inch, then apply custom resolution.
19 inline double pointToPixel(const double fPoint, const double fResolutionDPI)
21 return o3tl::convert(fPoint, o3tl::Length::pt, o3tl::Length::in) * fResolutionDPI;
24 /// Decide if PDF data is old enough to be compatible.
25 bool isCompatible(SvStream& rInStream, sal_uInt64 nPos, sal_uInt64 nSize);
27 /// Converts to highest supported format version (currently 1.6).
28 /// Usually used to deal with missing referenced objects in the
29 /// source pdf stream.
30 bool convertToHighestSupported(SvStream& rInStream, SvStream& rOutStream);
32 /// Takes care of transparently downgrading the version of the PDF stream in
33 /// case it's too new for our PDF export.
34 bool getCompatibleStream(SvStream& rInStream, SvStream& rOutStream);
36 BinaryDataContainer createBinaryDataContainer(SvStream& rStream);
38 } // end of vcl::filter::ipdf namespace
40 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */