20 #ifndef INCLUDED_SDEXT_SOURCE_PDFIMPORT_INC_PDFIPROCESSOR_HXX
21 #define INCLUDED_SDEXT_SOURCE_PDFIMPORT_INC_PDFIPROCESSOR_HXX
23 #include <com/sun/star/task/XStatusIndicator.hpp>
24 #include <com/sun/star/geometry/RealSize2D.hpp>
25 #include <com/sun/star/geometry/RealRectangle2D.hpp>
26 #include <com/sun/star/geometry/Matrix2D.hpp>
30 #include <rtl/ustring.hxx>
33 #include <unordered_map>
45 struct DocumentElement;
63 explicit PDFIProcessor(
const css::uno::Reference< css::task::XStatusIndicator >& xStat,
64 css::uno::Reference< css::uno::XComponentContext >
const & xContext) ;
82 static OUString
mirrorString(
const OUString& i_rInString );
89 virtual void setPageNum( sal_Int32 nNumPages )
override;
90 virtual void startPage(
const css::geometry::RealSize2D& rSize )
override;
91 virtual void endPage()
override;
93 virtual void hyperLink(
const css::geometry::RealRectangle2D& rBounds,
94 const OUString& rURI )
override;
98 virtual void setTransformation(
const css::geometry::AffineMatrix2D& rMatrix )
override;
99 virtual void setLineDash(
const css::uno::Sequence<double>& dashes,
100 double start )
override;
105 virtual void setFillColor(
const css::rendering::ARGBColor& rColor )
override;
106 virtual void setStrokeColor(
const css::rendering::ARGBColor& rColor )
override;
110 virtual void strokePath(
const css::uno::Reference<
111 css::rendering::XPolyPolygon2D >& rPath )
override;
112 virtual void fillPath(
const css::uno::Reference<
113 css::rendering::XPolyPolygon2D >& rPath )
override;
114 virtual void eoFillPath(
const css::uno::Reference<
115 css::rendering::XPolyPolygon2D >& rPath )
override;
118 css::rendering::XPolyPolygon2D >& rPath)
override;
120 css::rendering::XPolyPolygon2D >& rPath)
override;
122 virtual void drawGlyphs(
const OUString& rGlyphs,
123 const css::geometry::RealRectangle2D& rRect,
124 const css::geometry::Matrix2D& rFontMatrix,
125 double fontSize)
override;
126 virtual void endText()
override;
128 virtual void drawMask(
const css::uno::Sequence<
129 css::beans::PropertyValue>& xBitmap,
130 bool bInvert )
override;
132 virtual void drawImage(
const css::uno::Sequence<
133 css::beans::PropertyValue>& xBitmap )
override;
139 css::beans::PropertyValue>& xBitmap,
140 const css::uno::Sequence<
141 css::uno::Any>& xMaskColors )
override;
143 css::beans::PropertyValue>& xBitmap,
144 const css::uno::Sequence<
145 css::beans::PropertyValue>& xMask,
146 bool bInvertMask)
override;
148 css::beans::PropertyValue>& xImage,
149 const css::uno::Sequence<
150 css::beans::PropertyValue>& xMask)
override;
158 typedef std::unordered_map<FontAttributes,sal_Int32,FontAttrHash>
FontToIdMap;
160 typedef std::unordered_map<sal_Int32,GraphicsContext>
IdToGCMap;
161 typedef std::unordered_map<GraphicsContext, sal_Int32, GraphicsContextHash>
GCToIdMap;
183 css::uno::Reference< css::task::XStatusIndicator >
190 double width,
double prevSpaceWidth,
const OUString& rGlyphs )
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void endText() override
issued when a sequence of associated glyphs is drawn
std::unordered_map< FontAttributes, sal_Int32, FontAttrHash > FontToIdMap
static OUString mirrorString(const OUString &i_rInString)
std::unordered_map< sal_Int32, GraphicsContext > IdToGCMap
GraphicsContext m_rCurrentContext
Main entry from the parser.
const FontAttributes & getFont(sal_Int32 nFontId) const
virtual void setFillColor(const css::rendering::ARGBColor &rColor) override
void setupImage(ImageId nImage)
virtual void pushState() override
virtual void intersectClip(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
double getPrevSpaceWidth() const
const GraphicsContext & getGraphicsContext(sal_Int32 nGCId) const
virtual void setLineWidth(double) override
std::shared_ptr< DocumentElement > m_pDocument
sal_Int32 getGCId(const GraphicsContext &rGC)
virtual void setStrokeColor(const css::rendering::ARGBColor &rColor) override
void startIndicator(const OUString &rText)
virtual void drawMaskedImage(const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::beans::PropertyValue > &xMask, bool bInvertMask) 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)
std::vector< GraphicsContext > GraphicsContextStack
virtual void setTextRenderMode(sal_Int32) override
virtual void setPageNum(sal_Int32 nNumPages) override
Total number of pages for upcoming document.
std::unordered_map< sal_Int32, FontAttributes > IdToFontMap
css::uno::Reference< css::task::XStatusIndicator > m_xStatusIndicator
virtual void setMiterLimit(double) override
Tree manipulation factory.
virtual void setLineJoin(sal_Int8) override
std::vector< CharGlyph > m_GlyphsList
virtual void setLineCap(sal_Int8) override
virtual void drawAlphaMaskedImage(const css::uno::Sequence< css::beans::PropertyValue > &xImage, const css::uno::Sequence< css::beans::PropertyValue > &xMask) override
GraphicsContext & getGC()
void emit(XmlEmitter &rEmitter, const TreeVisitorFactory &rVisitorFactory)
(preliminary) API wrapper around xpdf
const css::uno::Reference< css::task::XStatusIndicator > & getStatusIndicator() const
virtual void setTransformation(const css::geometry::AffineMatrix2D &rMatrix) 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 endPage() override
virtual void startPage(const css::geometry::RealSize2D &rSize) override
GraphicsContext & getCurrentContext()
Element * getCurElement()
sal_Int32 getFontId(const FontAttributes &rAttr) const
static void sortElements(Element *pElement)
virtual void intersectEoClip(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
virtual void setFlatness(double) override
const GraphicsContext & getCurrentContext() const
std::unordered_map< GraphicsContext, sal_Int32, GraphicsContextHash > GCToIdMap
virtual void strokePath(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
CharGlyph(Element *pCurElement, const GraphicsContext &rCurrentContext, double width, double prevSpaceWidth, const OUString &rGlyphs)
GraphicsContextStack m_aGCStack
virtual void eoFillPath(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
virtual void drawGlyphs(const OUString &rGlyphs, const css::geometry::RealRectangle2D &rRect, const css::geometry::Matrix2D &rFontMatrix, double fontSize) override
virtual void popState() override
virtual void setLineDash(const css::uno::Sequence< double > &dashes, double start) override
virtual void hyperLink(const css::geometry::RealRectangle2D &rBounds, const OUString &rURI) override
virtual void setFont(const FontAttributes &rFont) 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.
virtual void fillPath(const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
PDFIProcessor(const css::uno::Reference< css::task::XStatusIndicator > &xStat, css::uno::Reference< css::uno::XComponentContext > const &xContext)
basegfx::B2DHomMatrix prevTextMatrix