20#ifndef INCLUDED_SDEXT_SOURCE_PDFIMPORT_INC_PDFIPROCESSOR_HXX
21#define INCLUDED_SDEXT_SOURCE_PDFIMPORT_INC_PDFIPROCESSOR_HXX
23#include <com/sun/star/uno/XComponentContext.hpp>
24#include <com/sun/star/task/XStatusIndicator.hpp>
25#include <com/sun/star/geometry/RealSize2D.hpp>
26#include <com/sun/star/geometry/RealRectangle2D.hpp>
27#include <com/sun/star/geometry/Matrix2D.hpp>
31#include <rtl/ustring.hxx>
34#include <unordered_map>
46 struct DocumentElement;
64 explicit PDFIProcessor(
const css::uno::Reference< css::task::XStatusIndicator >& xStat,
65 css::uno::Reference< css::uno::XComponentContext >
const & xContext) ;
90 virtual void setPageNum( sal_Int32 nNumPages )
override;
91 virtual void startPage(
const css::geometry::RealSize2D& rSize )
override;
92 virtual void endPage()
override;
94 virtual void hyperLink(
const css::geometry::RealRectangle2D& rBounds,
95 const OUString& rURI )
override;
99 virtual void setTransformation(
const css::geometry::AffineMatrix2D& rMatrix )
override;
100 virtual void setLineDash(
const css::uno::Sequence<double>& dashes,
101 double start )
override;
106 virtual void setFillColor(
const css::rendering::ARGBColor& rColor )
override;
107 virtual void setStrokeColor(
const css::rendering::ARGBColor& rColor )
override;
111 virtual void strokePath(
const css::uno::Reference<
112 css::rendering::XPolyPolygon2D >& rPath )
override;
113 virtual void fillPath(
const css::uno::Reference<
114 css::rendering::XPolyPolygon2D >& rPath )
override;
115 virtual void eoFillPath(
const css::uno::Reference<
116 css::rendering::XPolyPolygon2D >& rPath )
override;
119 css::rendering::XPolyPolygon2D >& rPath)
override;
121 css::rendering::XPolyPolygon2D >& rPath)
override;
123 virtual void drawGlyphs(
const OUString& rGlyphs,
124 const css::geometry::RealRectangle2D& rRect,
125 const css::geometry::Matrix2D& rFontMatrix,
126 double fontSize)
override;
127 virtual void endText()
override;
129 virtual void drawMask(
const css::uno::Sequence<
130 css::beans::PropertyValue>& xBitmap,
131 bool bInvert )
override;
133 virtual void drawImage(
const css::uno::Sequence<
134 css::beans::PropertyValue>& xBitmap )
override;
140 css::beans::PropertyValue>& xBitmap,
141 const css::uno::Sequence<
142 css::uno::Any>& xMaskColors )
override;
144 css::beans::PropertyValue>& xBitmap,
145 const css::uno::Sequence<
146 css::beans::PropertyValue>& xMask,
147 bool bInvertMask)
override;
149 css::beans::PropertyValue>& xImage,
150 const css::uno::Sequence<
151 css::beans::PropertyValue>& xMask)
override;
159 typedef std::unordered_map<FontAttributes,sal_Int32,FontAttrHash>
FontToIdMap;
161 typedef std::unordered_map<sal_Int32,GraphicsContext>
IdToGCMap;
162 typedef std::unordered_map<GraphicsContext, sal_Int32, GraphicsContextHash>
GCToIdMap;
184 css::uno::Reference< css::task::XStatusIndicator >
191 double width,
double prevSpaceWidth,
const OUString& rGlyphs )
CharGlyph(Element *pCurElement, const GraphicsContext &rCurrentContext, double width, double prevSpaceWidth, const OUString &rGlyphs)
GraphicsContext m_rCurrentContext
double getPrevSpaceWidth() const
Element * getCurElement()
GraphicsContext & getGC()
Main entry from the parser.
void startIndicator(const OUString &rText)
std::unordered_map< FontAttributes, sal_Int32, FontAttrHash > FontToIdMap
std::vector< CharGlyph > m_GlyphsList
virtual void setLineWidth(double) override
virtual void drawColorMaskedImage(const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::uno::Any > &xMaskColors) override
Given image must already be color-mapped and normalized to sRGB.
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void setFlatness(double) override
virtual void setTransformation(const css::geometry::AffineMatrix2D &rMatrix) override
virtual void setMiterLimit(double) override
const GraphicsContext & getGraphicsContext(sal_Int32 nGCId) const
virtual void intersectClip(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
std::unordered_map< sal_Int32, GraphicsContext > IdToGCMap
virtual void setLineDash(const css::uno::Sequence< double > &dashes, double start) override
virtual void popState() override
virtual void hyperLink(const css::geometry::RealRectangle2D &rBounds, const OUString &rURI) override
basegfx::B2DHomMatrix prevTextMatrix
const FontAttributes & getFont(sal_Int32 nFontId) const
virtual void setPageNum(sal_Int32 nNumPages) override
Total number of pages for upcoming document.
virtual void strokePath(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
sal_Int32 getFontId(const FontAttributes &rAttr) const
virtual void setLineCap(sal_Int8) override
const css::uno::Reference< css::task::XStatusIndicator > & getStatusIndicator() const
virtual void pushState() override
std::unordered_map< sal_Int32, FontAttributes > IdToFontMap
void setupImage(ImageId nImage)
static void sortElements(Element *pElement)
PDFIProcessor(const css::uno::Reference< css::task::XStatusIndicator > &xStat, css::uno::Reference< css::uno::XComponentContext > const &xContext)
const GraphicsContext & getCurrentContext() const
virtual void endPage() override
std::vector< GraphicsContext > GraphicsContextStack
virtual void intersectEoClip(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
virtual void drawMask(const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, bool bInvert) override
draws given bitmap as a mask (using current fill color)
virtual void setStrokeColor(const css::rendering::ARGBColor &rColor) override
virtual void drawMaskedImage(const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::beans::PropertyValue > &xMask, bool bInvertMask) override
static OUString SubstituteBidiMirrored(const OUString &rString)
GraphicsContext & getCurrentContext()
virtual void setLineJoin(sal_Int8) override
virtual void setFillColor(const css::rendering::ARGBColor &rColor) override
std::unordered_map< GraphicsContext, sal_Int32, GraphicsContextHash > GCToIdMap
GraphicsContextStack m_aGCStack
std::shared_ptr< DocumentElement > m_pDocument
virtual void setTextRenderMode(sal_Int32) override
virtual void eoFillPath(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
sal_Int32 getGCId(const GraphicsContext &rGC)
virtual void drawGlyphs(const OUString &rGlyphs, const css::geometry::RealRectangle2D &rRect, const css::geometry::Matrix2D &rFontMatrix, double fontSize) override
virtual void drawAlphaMaskedImage(const css::uno::Sequence< css::beans::PropertyValue > &xImage, const css::uno::Sequence< css::beans::PropertyValue > &xMask) override
css::uno::Reference< css::task::XStatusIndicator > m_xStatusIndicator
virtual void startPage(const css::geometry::RealSize2D &rSize) override
virtual void endText() override
issued when a sequence of associated glyphs is drawn
virtual void setFont(const FontAttributes &rFont) override
virtual void drawImage(const css::uno::Sequence< css::beans::PropertyValue > &xBitmap) override
Given image must already be color-mapped and normalized to sRGB.
virtual void fillPath(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
void emit(XmlEmitter &rEmitter, const TreeVisitorFactory &rVisitorFactory)
(preliminary) API wrapper around xpdf
Tree manipulation factory.