LibreOffice Module sdext (master)  1
Classes | Typedefs | Enumerations | Functions
pdfi Namespace Reference

Classes

class  CharGlyph
 
struct  ContentSink
 (preliminary) API wrapper around xpdf More...
 
struct  DocumentElement
 
struct  DrawElement
 
class  DrawXmlEmitter
 
class  DrawXmlFinalizer
 
class  DrawXmlOptimizer
 
struct  Element
 
class  ElementFactory
 
struct  ElementTreeVisitor
 To be visited by all tree element types. More...
 
struct  EmitContext
 
struct  FontAttrHash
 
struct  FontAttributes
 
struct  FrameElement
 
struct  GraphicalElement
 
struct  GraphicsContext
 
struct  GraphicsContextHash
 
struct  HyperlinkElement
 
class  ImageContainer
 
struct  ImageElement
 
struct  ListElement
 
class  OutputWrap
 
class  OutputWrapString
 
struct  PageElement
 
struct  ParagraphElement
 
class  PDFDetector
 
class  PDFIHybridAdaptor
 
class  PDFIProcessor
 Main entry from the parser. More...
 
class  PDFIRawAdaptor
 Adapts raw pdf import to XImportFilter interface. More...
 
class  PDFOutDev
 
class  PngHelper
 
struct  PolyPolyElement
 
class  SaxAttrList
 
class  SaxEmitter
 
class  StyleContainer
 
struct  TextElement
 
struct  TreeVisitorFactory
 Tree manipulation factory. More...
 
class  WriterXmlEmitter
 
class  WriterXmlFinalizer
 
class  WriterXmlOptimizer
 
class  XmlEmitter
 Output interface to ODF. More...
 

Typedefs

typedef ::cppu::WeakComponentImplHelper< css::document::XExtendedFilterDetection, css::lang::XServiceInfo > PDFDetectorBase
 
typedef std::shared_ptr< ContentSinkContentSinkSharedPtr
 
typedef std::unordered_map< OUString, OUString > PropertyMap
 
typedef sal_Int32 ImageId
 
typedef std::shared_ptr< ElementTreeVisitorElementTreeVisitorSharedPtr
 
typedef std::shared_ptr< TreeVisitorFactoryTreeVisitorFactorySharedPtr
 
typedef std::shared_ptr< XmlEmitterXmlEmitterSharedPtr
 
typedef ::cppu::WeakComponentImplHelper< css::document::XFilter, css::document::XImporter, css::lang::XServiceInfo > PDFIHybridAdaptorBase
 
typedef ::cppu::WeakComponentImplHelper< css::xml::XImportFilter, css::document::XImporter, css::lang::XServiceInfo > PDFIAdaptorBase
 
typedef ::cppu::WeakComponentImplHelper< css::io::XOutputStream > OutputWrapBase
 
typedef GBool poppler_bool
 

Enumerations

enum  PolygonAction {
  PATH_STROKE =1,
  PATH_FILL =2,
  PATH_EOFILL =4
}
 What to do with a polygon. values can be ORed together. More...
 

Functions

bool checkDocChecksum (const OUString &rInPDFFileURL, sal_uInt32 nBytes, const OUString &rChkSum)
 
uno::Reference< io::XStream > getAdditionalStream (const OUString &rInPDFFileURL, OUString &rOutMimetype, OUString &io_rPwd, const uno::Reference< uno::XComponentContext > &xContext, const uno::Sequence< beans::PropertyValue > &rFilterData, bool bMayUseUI)
 
css::uno::Reference< css::io::XStream > getAdditionalStream (const OUString &rPDFFile, OUString &o_rOutMimetype, OUString &io_rOutPwd, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Sequence< css::beans::PropertyValue > &rFilterData, bool bMayUseUI)
 Retrieve embedded substream from PDF file. More...
 
XmlEmitterSharedPtr createOdfEmitter (const css::uno::Reference< css::io::XOutputStream > &xOut)
 
OUString unitMMString (double fMM)
 
OUString convertPixelToUnitString (double fPix)
 
double convPx2mm (double fPix)
 
double convmm2Px (double fMM)
 
double convPx2mmPrec2 (double fPix)
 
OUString getColorString (const css::rendering::ARGBColor &)
 Convert color to "#FEFEFE" color notation. More...
 
OUString getPercentString (double value)
 
double GetAverageTransformationScale (const basegfx::B2DHomMatrix &matrix)
 
void FillDashStyleProps (PropertyMap &props, const std::vector< double > &dashArray, double scale)
 
bool getPassword (const css::uno::Reference< css::task::XInteractionHandler > &xHandler, OUString &rOutPwd, bool bFirstTry, const OUString &rDocName)
 retrieve password from user More...
 
void reportUnsupportedEncryptionFormat (css::uno::Reference< css::task::XInteractionHandler > const &handler)
 
XmlEmitterSharedPtr createSaxEmitter (const css::uno::Reference< css::xml::sax::XDocumentHandler > &xDocHdl)
 
TreeVisitorFactorySharedPtr createWriterTreeVisitorFactory ()
 
TreeVisitorFactorySharedPtr createImpressTreeVisitorFactory ()
 
TreeVisitorFactorySharedPtr createDrawTreeVisitorFactory ()
 
bool xpdf_ImportFromFile (const OUString &rURL, const ContentSinkSharedPtr &rSink, const css::uno::Reference< css::task::XInteractionHandler > &xIHdl, const OUString &rPwd, const css::uno::Reference< css::uno::XComponentContext > &xContext, const OUString &rFilterOptions)
 
bool xpdf_ImportFromStream (const css::uno::Reference< css::io::XInputStream > &xInput, const ContentSinkSharedPtr &rSink, const css::uno::Reference< css::task::XInteractionHandler > &xIHdl, const OUString &rPwd, const css::uno::Reference< css::uno::XComponentContext > &xContext, const OUString &rFilterOptions)
 
bool getPassword (const uno::Reference< task::XInteractionHandler > &xHandler, OUString &rOutPwd, bool bFirstTry, const OUString &rDocName)
 
void reportUnsupportedEncryptionFormat (uno::Reference< task::XInteractionHandler > const &handler)
 
XmlEmitterSharedPtr createOdfEmitter (const uno::Reference< io::XOutputStream > &xOut)
 
XmlEmitterSharedPtr createSaxEmitter (const uno::Reference< xml::sax::XDocumentHandler > &xDocHdl)
 
static bool isSpaces (TextElement *pTextElem)
 
static bool notTransformed (const GraphicsContext &GC)
 
static void SetFontsizeProperties (PropertyMap &props, double fontSize)
 
static bool lr_tb_sort (std::unique_ptr< Element > const &pLeft, std::unique_ptr< Element > const &pRight)
 
static bool checkEncryption (const OUString &i_rPath, const uno::Reference< task::XInteractionHandler > &i_xIHdl, OUString &io_rPwd, bool &o_rIsEncrypted, const OUString &i_rDocName)
 
bool xpdf_ImportFromFile (const OUString &rURL, const ContentSinkSharedPtr &rSink, const uno::Reference< task::XInteractionHandler > &xIHdl, const OUString &rPwd, const uno::Reference< uno::XComponentContext > &xContext, const OUString &rFilterOptions)
 
bool xpdf_ImportFromStream (const uno::Reference< io::XInputStream > &xInput, const ContentSinkSharedPtr &rSink, const uno::Reference< task::XInteractionHandler > &xIHdl, const OUString &rPwd, const uno::Reference< uno::XComponentContext > &xContext, const OUString &rFilterOptions)
 
static double normalize (double val)
 cut off very small numbers & clamp value to zero More...
 
static void initBuf (OutputBuffer &io_rBuffer)
 
static void writeBinaryBuffer (const OutputBuffer &rBuffer)
 
static bool ExtractJpegData (Stream *str, OutputBuffer &outBuf)
 
static void writeJpeg_ (OutputBuffer &o_rOutputBuf, Stream *str)
 
static void writePbm_ (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, bool bInvert)
 
static void writePpm_ (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, GfxImageColorMap *colorMap)
 
static void writePng_ (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, GfxRGB const &zeroColor, GfxRGB const &oneColor, bool bIsMask)
 
static void writePng_ (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap)
 
static void writePng_ (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert)
 
static void writeMask_ (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, bool bInvert)
 
static void writeImage_ (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, GfxImageColorMap *colorMap)
 
static void writeImageLF (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, GfxImageColorMap *colorMap)
 
static void writeMaskLF (OutputBuffer &o_rOutputBuf, Stream *str, int width, int height, bool bInvert)
 

Typedef Documentation

typedef std::shared_ptr<ContentSink> pdfi::ContentSinkSharedPtr

Definition at line 175 of file contentsink.hxx.

Definition at line 56 of file treevisiting.hxx.

typedef sal_Int32 pdfi::ImageId

Definition at line 46 of file pdfihelper.hxx.

typedef ::cppu::WeakComponentImplHelper< css::io::XOutputStream > pdfi::OutputWrapBase

Definition at line 34 of file outputwrap.hxx.

typedef ::cppu::WeakComponentImplHelper< css::document::XExtendedFilterDetection, css::lang::XServiceInfo> pdfi::PDFDetectorBase

Definition at line 36 of file filterdet.hxx.

typedef ::cppu::WeakComponentImplHelper< css::xml::XImportFilter, css::document::XImporter, css::lang::XServiceInfo> pdfi::PDFIAdaptorBase

Definition at line 78 of file pdfiadaptor.hxx.

typedef ::cppu::WeakComponentImplHelper< css::document::XFilter, css::document::XImporter, css::lang::XServiceInfo> pdfi::PDFIHybridAdaptorBase

Definition at line 46 of file pdfiadaptor.hxx.

typedef GBool pdfi::poppler_bool

Definition at line 136 of file pdfioutdev_gpl.hxx.

typedef std::unordered_map< OUString, OUString > pdfi::PropertyMap

Definition at line 45 of file pdfihelper.hxx.

Definition at line 50 of file treevisitorfactory.hxx.

typedef std::shared_ptr<XmlEmitter> pdfi::XmlEmitterSharedPtr

Definition at line 48 of file xmlemitter.hxx.

Enumeration Type Documentation

What to do with a polygon. values can be ORed together.

Enumerator
PATH_STROKE 
PATH_FILL 
PATH_EOFILL 

Definition at line 49 of file pdfihelper.hxx.

Function Documentation

bool pdfi::checkDocChecksum ( const OUString &  rInPDFFileURL,
sal_uInt32  nBytes,
const OUString &  rChkSum 
)
static bool pdfi::checkEncryption ( const OUString &  i_rPath,
const uno::Reference< task::XInteractionHandler > &  i_xIHdl,
OUString &  io_rPwd,
bool &  o_rIsEncrypted,
const OUString &  i_rDocName 
)
static
OUString pdfi::convertPixelToUnitString ( double  fPix)
double pdfi::convmm2Px ( double  fMM)
inline
double pdfi::convPx2mm ( double  fPix)
inline
double pdfi::convPx2mmPrec2 ( double  fPix)
inline

Definition at line 68 of file pdfihelper.hxx.

References convPx2mm().

Referenced by pdfi::WriterXmlEmitter::visit(), and pdfi::DrawXmlEmitter::visit().

TreeVisitorFactorySharedPtr pdfi::createDrawTreeVisitorFactory ( )

Definition at line 109 of file treevisitorfactory.cxx.

Referenced by SAL_IMPLEMENT_MAIN_WITH_ARGS().

TreeVisitorFactorySharedPtr pdfi::createImpressTreeVisitorFactory ( )

Definition at line 105 of file treevisitorfactory.cxx.

Referenced by SAL_IMPLEMENT_MAIN_WITH_ARGS().

XmlEmitterSharedPtr pdfi::createOdfEmitter ( const css::uno::Reference< css::io::XOutputStream > &  xOut)
XmlEmitterSharedPtr pdfi::createOdfEmitter ( const uno::Reference< io::XOutputStream > &  xOut)

Definition at line 117 of file odfemitter.cxx.

XmlEmitterSharedPtr pdfi::createSaxEmitter ( const css::uno::Reference< css::xml::sax::XDocumentHandler > &  xDocHdl)
XmlEmitterSharedPtr pdfi::createSaxEmitter ( const uno::Reference< xml::sax::XDocumentHandler > &  xDocHdl)

Definition at line 172 of file emitcontext.cxx.

TreeVisitorFactorySharedPtr pdfi::createWriterTreeVisitorFactory ( )

Definition at line 101 of file treevisitorfactory.cxx.

Referenced by SAL_IMPLEMENT_MAIN_WITH_ARGS().

static bool pdfi::ExtractJpegData ( Stream *  str,
OutputBuffer outBuf 
)
static

Definition at line 141 of file pdfioutdev_gpl.cxx.

Referenced by writeJpeg_().

void pdfi::FillDashStyleProps ( PropertyMap props,
const std::vector< double > &  dashArray,
double  scale 
)
css::uno::Reference< css::io::XStream > pdfi::getAdditionalStream ( const OUString &  rPDFFile,
OUString &  o_rOutMimetype,
OUString &  io_rOutPwd,
const css::uno::Reference< css::uno::XComponentContext > &  xContext,
const css::uno::Sequence< css::beans::PropertyValue > &  rFilterData,
bool  bMayUseUI 
)

Retrieve embedded substream from PDF file.

Useful e.g. for hybrid PDF

Parameters
rPDFFileURI of the pdf file
o_rOutMimetypeOutput parameter. Receives the mime type of the substream. Used to distinguish between draw/impress/writer/calc during import
o_rOutPwdIn/Out parameter. If given password is wrong, user is queried for another (if bMayUseUI is true)
xContextComponent context
rFilterDataBasically used to pass on XFilter::filter properties (function uses it to retrieve interaction handler)
bMayUseUIWhen false, no dialog is opened to query user for alternate password
uno::Reference< io::XStream > pdfi::getAdditionalStream ( const OUString &  rInPDFFileURL,
OUString &  rOutMimetype,
OUString &  io_rPwd,
const uno::Reference< uno::XComponentContext > &  xContext,
const uno::Sequence< beans::PropertyValue > &  rFilterData,
bool  bMayUseUI 
)
double pdfi::GetAverageTransformationScale ( const basegfx::B2DHomMatrix matrix)
OUString pdfi::getColorString ( const css::rendering::ARGBColor &  )

Convert color to "#FEFEFE" color notation.

Referenced by pdfi::WriterXmlFinalizer::visit(), and pdfi::DrawXmlFinalizer::visit().

bool pdfi::getPassword ( const uno::Reference< task::XInteractionHandler > &  xHandler,
OUString &  rOutPwd,
bool  bFirstTry,
const OUString &  rDocName 
)

Definition at line 152 of file pwdinteract.cxx.

bool pdfi::getPassword ( const css::uno::Reference< css::task::XInteractionHandler > &  xHandler,
OUString &  rOutPwd,
bool  bFirstTry,
const OUString &  rDocName 
)

retrieve password from user

Referenced by checkEncryption(), and getAdditionalStream().

OUString pdfi::getPercentString ( double  value)

Definition at line 102 of file pdfihelper.cxx.

Referenced by pdfi::DrawXmlFinalizer::visit().

static void pdfi::initBuf ( OutputBuffer io_rBuffer)
static
static bool pdfi::isSpaces ( TextElement pTextElem)
static

Definition at line 638 of file drawtreevisiting.cxx.

References i, and pdfi::TextElement::Text.

Referenced by pdfi::DrawXmlOptimizer::optimizeTextElements().

static bool pdfi::lr_tb_sort ( std::unique_ptr< Element > const &  pLeft,
std::unique_ptr< Element > const &  pRight 
)
static

Definition at line 618 of file pdfiprocessor.cxx.

Referenced by pdfi::PDFIProcessor::sortElements().

static double pdfi::normalize ( double  val)
static
static bool pdfi::notTransformed ( const GraphicsContext GC)
static
void pdfi::reportUnsupportedEncryptionFormat ( uno::Reference< task::XInteractionHandler > const &  handler)

Definition at line 179 of file pwdinteract.cxx.

void pdfi::reportUnsupportedEncryptionFormat ( css::uno::Reference< css::task::XInteractionHandler > const &  handler)

Referenced by checkEncryption().

static void pdfi::SetFontsizeProperties ( PropertyMap props,
double  fontSize 
)
static

Definition at line 812 of file drawtreevisiting.cxx.

References PDFI_OUTDEV_RESOLUTION.

Referenced by pdfi::DrawXmlFinalizer::visit().

OUString pdfi::unitMMString ( double  fMM)

Definition at line 107 of file pdfihelper.cxx.

References aBuf.

Referenced by pdfi::WriterXmlFinalizer::visit(), and pdfi::DrawXmlFinalizer::visit().

static void pdfi::writeBinaryBuffer ( const OutputBuffer rBuffer)
static
static void pdfi::writeImage_ ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
GfxImageColorMap *  colorMap 
)
static

Definition at line 382 of file pdfioutdev_gpl.cxx.

References nIndex, writeJpeg_(), writePng_(), and writePpm_().

Referenced by writeImageLF().

static void pdfi::writeImageLF ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
GfxImageColorMap *  colorMap 
)
static

Definition at line 418 of file pdfioutdev_gpl.cxx.

References writeImage_().

Referenced by pdfi::PDFOutDev::drawImage().

static void pdfi::writeJpeg_ ( OutputBuffer o_rOutputBuf,
Stream *  str 
)
static

Definition at line 207 of file pdfioutdev_gpl.cxx.

References ExtractJpegData().

Referenced by writeImage_(), and writeMask_().

static void pdfi::writeMask_ ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
bool  bInvert 
)
static

Definition at line 374 of file pdfioutdev_gpl.cxx.

References writeJpeg_(), and writePbm_().

Referenced by writeMaskLF().

static void pdfi::writeMaskLF ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
bool  bInvert 
)
static

Definition at line 423 of file pdfioutdev_gpl.cxx.

References writeMask_().

Referenced by pdfi::PDFOutDev::drawImageMask().

static void pdfi::writePbm_ ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
bool  bInvert 
)
static

Definition at line 226 of file pdfioutdev_gpl.cxx.

References i, size, and WRITE_BUFFER_SIZE.

Referenced by writeMask_().

static void pdfi::writePng_ ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
GfxRGB const &  zeroColor,
GfxRGB const &  oneColor,
bool  bIsMask 
)
static
static void pdfi::writePng_ ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
GfxImageColorMap *  colorMap,
Stream *  maskStr,
int  maskWidth,
int  maskHeight,
GfxImageColorMap *  maskColorMap 
)
static

Definition at line 343 of file pdfioutdev_gpl.cxx.

References pdfi::PngHelper::createPng().

static void pdfi::writePng_ ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
GfxImageColorMap *  colorMap,
Stream *  maskStr,
int  maskWidth,
int  maskHeight,
bool  maskInvert 
)
static

Definition at line 358 of file pdfioutdev_gpl.cxx.

References pdfi::PngHelper::createPng().

static void pdfi::writePpm_ ( OutputBuffer o_rOutputBuf,
Stream *  str,
int  width,
int  height,
GfxImageColorMap *  colorMap 
)
static

Definition at line 268 of file pdfioutdev_gpl.cxx.

References p, size, WRITE_BUFFER_SIZE, x, and y.

Referenced by writeImage_().

bool pdfi::xpdf_ImportFromFile ( const OUString &  rURL,
const ContentSinkSharedPtr rSink,
const css::uno::Reference< css::task::XInteractionHandler > &  xIHdl,
const OUString &  rPwd,
const css::uno::Reference< css::uno::XComponentContext > &  xContext,
const OUString &  rFilterOptions 
)
bool pdfi::xpdf_ImportFromFile ( const OUString &  rURL,
const ContentSinkSharedPtr rSink,
const uno::Reference< task::XInteractionHandler > &  xIHdl,
const OUString &  rPwd,
const uno::Reference< uno::XComponentContext > &  xContext,
const OUString &  rFilterOptions 
)

Definition at line 998 of file wrapper.cxx.

References aBuf, args, checkEncryption(), OUStringToOString(), SAL_INFO, and SAL_WARN.

Referenced by xpdf_ImportFromStream().

bool pdfi::xpdf_ImportFromStream ( const css::uno::Reference< css::io::XInputStream > &  xInput,
const ContentSinkSharedPtr rSink,
const css::uno::Reference< css::task::XInteractionHandler > &  xIHdl,
const OUString &  rPwd,
const css::uno::Reference< css::uno::XComponentContext > &  xContext,
const OUString &  rFilterOptions 
)
bool pdfi::xpdf_ImportFromStream ( const uno::Reference< io::XInputStream > &  xInput,
const ContentSinkSharedPtr rSink,
const uno::Reference< task::XInteractionHandler > &  xIHdl,
const OUString &  rPwd,
const uno::Reference< uno::XComponentContext > &  xContext,
const OUString &  rFilterOptions 
)

Definition at line 1177 of file wrapper.cxx.

References aBuf, aURL, and xpdf_ImportFromFile().