summaryrefslogtreecommitdiff
path: root/vcl/inc/pdf/pdfcompat.hxx
blob: 0664a400f90e9e62b446913bb99d208cc14cd16d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#pragma once

#include <o3tl/unit_conversion.hxx>
#include <tools/stream.hxx>
#include <vcl/BinaryDataContainer.hxx>

namespace vcl::pdf
{
/// Convert to inch, then apply custom resolution.
inline double pointToPixel(const double fPoint, const double fResolutionDPI)
{
    return o3tl::convert(fPoint, o3tl::Length::pt, o3tl::Length::in) * fResolutionDPI;
}

/// Decide if PDF data is old enough to be compatible.
bool isCompatible(SvStream& rInStream, sal_uInt64 nPos, sal_uInt64 nSize);

/// Converts to highest supported format version (currently 1.6).
/// Usually used to deal with missing referenced objects in the
/// source pdf stream.
bool convertToHighestSupported(SvStream& rInStream, SvStream& rOutStream);

/// Takes care of transparently downgrading the version of the PDF stream in
/// case it's too new for our PDF export.
bool getCompatibleStream(SvStream& rInStream, SvStream& rOutStream);

BinaryDataContainer createBinaryDataContainer(SvStream& rStream);

} // end of vcl::filter::ipdf namespace

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
'>Stephan Bergmann 2019-03-24Resolves: tdf#122114 remove support for ~/.recently-used fileArkadiy Illarionov 2019-03-05improve documentation of soffice --accept parameterMichael Stahl 2018-12-17kde5: remove older kde/tde plugins, and references to thatThorsten Behrens 2018-11-14Add EMF and WMF mime types to Draw .desktop fileSamuel Mehrbrodt 2018-10-24don't try to verify .desktop files when building the menus.rpmChristian Lohmaier 2018-08-29Removed executable permission on simple ASCII filesAndrea Gelmini 2018-08-27apparmor: fix printing to fileVincas Dargis 2018-08-26boostrap->bootstrapCaolán McNamara 2018-08-15apparmor: fix access to /etc/xml/catalogVincas Dargis 2018-08-15apparmor: allow writing .epub filesVincas Dargis 2018-08-14apparmor: fix qt-related deniesVincas Dargis 2018-08-14Fix typosAndrea Gelmini 2018-08-14tdf#116856 Update screenshot imagesXisco Fauli 2018-08-14apparmor: update program.soffice.bin for KDEVincas Dargis 2018-08-10test apparmor profile parsing (see tdf#114915)Rene Engelhard 2018-08-07deb#905442 apparmor: fix saving files in enforced modeVincas Dargis 2018-07-18Fix typosAndrea Gelmini 2018-07-11sysui: try to fix Mac instsetsMichael Stahl 2018-07-03App icon updateandreas kainz 2018-06-25update app icns iconsandreas kainz 2018-06-17fix packaging break after bindir handling & new iconsChristian Lohmaier 2018-06-13Respect --bindir..orbea