|
LibreOffice Module svx (master) 1
|
#include <svdpdf.hxx>
Public Member Functions | |
| ImpSdrPdfImport (SdrModel &rModel, SdrLayerID nLay, const tools::Rectangle &rRect, Graphic const &rGraphic) | |
| ~ImpSdrPdfImport () | |
| int | GetPageCount () const |
| size_t | DoImport (SdrObjList &rDestList, size_t nInsPos, int nPageNumber, SvdProgressInfo *pProgrInfo=nullptr) |
Private Member Functions | |
| double | correctVertOrigin (double offsetPts) const |
| Correct the vertical coordinate to start at the top. More... | |
| tools::Rectangle | PointsToLogic (double left, double right, double top, double bottom) const |
| Convert PDF points to logic (twips). More... | |
| Point | PointsToLogic (double x, double y) const |
| void | checkClip () |
| bool | isClip () const |
| void | ImportPdfObject (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex) |
| void | ImportForm (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex) |
| void | ImportImage (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, int nPageObjectIndex) |
| void | ImportPath (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, int nPageObjectIndex) |
| void | ImportText (std::unique_ptr< vcl::pdf::PDFiumPageObject > const &pPageObject, std::unique_ptr< vcl::pdf::PDFiumTextPage > const &pTextPage, int nPageObjectIndex) |
| void | InsertTextObject (const Point &rPos, const Size &rSize, const OUString &rStr) |
| void | SetupPageScale (const double dPageWidth, const double dPageHeight) |
| void | SetAttributes (SdrObject *pObj, bool bForceTextAttr=false) |
| void | InsertObj (SdrObject *pObj, bool bScale=true) |
| void | MapScaling () |
| bool | CheckLastPolyLineAndFillMerge (const basegfx::B2DPolyPolygon &rPolyPolygon) |
| void | DoObjects (SvdProgressInfo *pProgrInfo, sal_uInt32 *pActionsToReport, int nPageIndex) |
| ImpSdrPdfImport (const ImpSdrPdfImport &)=delete | |
| ImpSdrPdfImport & | operator= (const ImpSdrPdfImport &)=delete |
Private Attributes | |
| std::vector< rtl::Reference< SdrObject > > | maTmpList |
| ScopedVclPtr< VirtualDevice > | mpVD |
| tools::Rectangle | maScaleRect |
| size_t | mnMapScalingOfs |
| std::unique_ptr< SfxItemSet > | mpLineAttr |
| std::unique_ptr< SfxItemSet > | mpFillAttr |
| std::unique_ptr< SfxItemSet > | mpTextAttr |
| SdrModel * | mpModel |
| SdrLayerID | mnLayer |
| Color | maOldLineColor |
| sal_Int32 | mnLineWidth |
| XDash | maDash |
| bool | mbMov |
| bool | mbSize |
| Point | maOfs |
| double | mfScaleX |
| double | mfScaleY |
| Fraction | maScaleX |
| Fraction | maScaleY |
| bool | mbFntDirty |
| bool | mbLastObjWasPolyWithoutLine |
| bool | mbNoLine |
| bool | mbNoFill |
| basegfx::B2DPolyPolygon | maClip |
| std::unique_ptr< vcl::pdf::PDFiumDocument > | mpPdfDocument |
| int | mnPageCount |
| double | mdPageHeightPts |
| basegfx::B2DHomMatrix | maCurrentMatrix |
| The current transformation matrix, typically used with Form objects. More... | |
| std::shared_ptr< vcl::pdf::PDFium > | mpPDFium |
Static Private Attributes | |
| static constexpr css::drawing::LineCap | gaLineCap = css::drawing::LineCap_BUTT |
Definition at line 47 of file svdpdf.hxx.
|
privatedelete |
| ImpSdrPdfImport::ImpSdrPdfImport | ( | SdrModel & | rModel, |
| SdrLayerID | nLay, | ||
| const tools::Rectangle & | rRect, | ||
| Graphic const & | rGraphic | ||
| ) |
Definition at line 77 of file svdpdf.cxx.
References checkClip(), get(), SdrModel::GetItemPool(), Graphic::getVectorGraphicData(), maOldLineColor, mnLayer, mnPageCount, mpFillAttr, mpLineAttr, mpPdfDocument, mpPDFium, mpTextAttr, mpVD, pData, and Color::SetRed().
|
default |
|
private |
Definition at line 629 of file svdpdf.cxx.
References basegfx::utils::createScaleTranslateB2DHomMatrix(), isClip(), maClip, maOfs, mfScaleX, mfScaleY, mpVD, basegfx::B2DPolyPolygon::transform(), Point::X(), and Point::Y().
Referenced by ImpSdrPdfImport().
|
private |
Definition at line 602 of file svdpdf.cxx.
References SdrPathObj::GetPathPoly(), maTmpList, mbLastObjWasPolyWithoutLine, mbNoFill, mbNoLine, mpLineAttr, SetAttributes(), and SdrObject::SetMergedItemSet().
Referenced by ImportPath().
|
inlineprivate |
Correct the vertical coordinate to start at the top.
PDF coordinate system has origin at the bottom right.
Definition at line 89 of file svdpdf.hxx.
References mdPageHeightPts.
Referenced by PointsToLogic().
| size_t ImpSdrPdfImport::DoImport | ( | SdrObjList & | rDestList, |
| size_t | nInsPos, | ||
| int | nPageNumber, | ||
| SvdProgressInfo * | pProgrInfo = nullptr |
||
| ) |
Definition at line 213 of file svdpdf.cxx.
References DoObjects(), SdrObjList::GetObjCount(), MapScaling(), maTmpList, SdrObjList::NbcInsertObject(), SvdProgressInfo::ReportActions(), SvdProgressInfo::ReportInserts(), SvdProgressInfo::ReportRescales(), and SvdProgressInfo::SetInsertCount().
Referenced by SdrEditView::DoImportMarkedMtf().
|
private |
Definition at line 127 of file svdpdf.cxx.
References basegfx::Size2D< typename TYPE >::getHeight(), basegfx::Size2D< typename TYPE >::getWidth(), ImportPdfObject(), mpPdfDocument, SvdProgressInfo::ReportActions(), SvdProgressInfo::SetActionCount(), and SetupPageScale().
Referenced by DoImport().
|
inline |
Definition at line 135 of file svdpdf.hxx.
References mnPageCount.
Referenced by SdrEditView::DoImportMarkedMtf().
|
private |
Definition at line 678 of file svdpdf.cxx.
References ImportPdfObject(), maCurrentMatrix, nCount, and nIndex.
Referenced by ImportPdfObject().
|
private |
Definition at line 852 of file svdpdf.cxx.
References tools::Rectangle::AdjustBottom(), tools::Rectangle::AdjustRight(), vcl::pdf::BGR, vcl::pdf::BGRA, vcl::pdf::BGRx, bottom, basegfx::Range2D< typename TYPE, typename TRAITS >::getMaxX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMaxY(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinY(), InsertObj(), left, mpModel, vcl::N24_BPP, PointsToLogic(), ReadRawDIB(), right, SAL_WARN, top, and vcl::pdf::Unknown.
Referenced by ImportPdfObject().
|
private |
Definition at line 912 of file svdpdf.cxx.
References vcl::pdf::Alternate, basegfx::B2DPolyPolygon::append(), basegfx::B2DPolygon::append(), basegfx::B2DPolygon::appendBezierSegment(), vcl::pdf::Bezierto, CheckLastPolyLineAndFillMerge(), basegfx::B2DPolygon::clear(), COL_TRANSPARENT(), convertPointToMm100(), basegfx::B2DPolygon::count(), basegfx::utils::createScaleTranslateB2DHomMatrix(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), InsertObj(), vcl::pdf::Lineto, maCurrentMatrix, maOfs, mbLastObjWasPolyWithoutLine, mfScaleX, mfScaleY, mnLineWidth, vcl::pdf::Moveto, mpModel, mpVD, PointsToLogic(), Polygon, SAL_WARN, SetAttributes(), basegfx::B2DPolygon::setClosed(), basegfx::Tuple2D< typename TYPE >::setX(), basegfx::Tuple2D< typename TYPE >::setY(), basegfx::B2DPolyPolygon::transform(), vcl::pdf::Unknown, vcl::pdf::Winding, Point::X(), and Point::Y().
Referenced by ImportPdfObject().
|
private |
Definition at line 646 of file svdpdf.cxx.
References vcl::pdf::Form, vcl::pdf::Image, ImportForm(), ImportImage(), ImportPath(), ImportText(), vcl::pdf::Path, SAL_WARN, vcl::pdf::Shading, and vcl::pdf::Text.
Referenced by DoObjects(), and ImportForm().
|
private |
Definition at line 699 of file svdpdf.cxx.
References basegfx::B2DHomMatrix::a(), basegfx::B2DHomMatrix::b(), basegfx::B2DHomMatrix::c(), vcl::pdf::Clip, COL_TRANSPARENT(), convertPointToMm100(), basegfx::B2DHomMatrix::d(), vcl::pdf::Fill, vcl::pdf::FillClip, vcl::pdf::FillStroke, vcl::pdf::FillStrokeClip, vcl::Font::GetFamilyName(), vcl::Font::GetFontSize(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMaxX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMaxY(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinY(), Color::GetRGBColor(), tools::Rectangle::GetSize(), InsertTextObject(), vcl::pdf::Invisible, maCurrentMatrix, mbFntDirty, mpVD, PointsToLogic(), vcl::Font::SetFamilyName(), vcl::Font::SetFontSize(), vcl::pdf::Stroke, vcl::pdf::StrokeClip, tools::Rectangle::TopLeft(), and vcl::pdf::Unknown.
Referenced by ImportPdfObject().
|
private |
Definition at line 396 of file svdpdf.cxx.
References bVisible, basegfx::utils::clipPolyPolygonOnPolyPolygon(), SdrObject::CloneSdrObject(), SdrObject::ConvertToPolyObj(), DeepNoGroups, DynCastSdrTextObj(), basegfx::fround(), basegfx::B2DPolyPolygon::getB2DRange(), Graphic::GetBitmapEx(), SdrGrafObj::GetGraphic(), basegfx::Range2D< typename TYPE, typename TRAITS >::getHeight(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinY(), SdrObject::getSdrModelFromSdrObject(), BitmapEx::GetSizePixel(), basegfx::Range2D< typename TYPE, typename TRAITS >::getWidth(), SdrTextObj::HasText(), Size::Height(), InsertObj(), isClip(), basegfx::B2DPolyPolygon::isClosed(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), tools::Rectangle::IsEmpty(), BitmapEx::IsEmpty(), basegfx::Range2D< typename TYPE, typename TRAITS >::isInside(), SdrObjListIter::IsMore(), basegfx::utils::isRectangle(), maClip, maOfs, maScaleRect, maScaleX, maScaleY, maTmpList, mbLastObjWasPolyWithoutLine, mbMov, mbNoLine, mbSize, mpModel, SdrObjListIter::Next(), basegfx::Range2D< typename TYPE, typename TRAITS >::overlaps(), Polygon, PolyLine, basegfx::B2DHomMatrix::scale(), SdrTextObj::TakeContour(), basegfx::B2DRange::transform(), basegfx::B2DHomMatrix::translate(), Size::Width(), Point::X(), and Point::Y().
Referenced by ImportImage(), ImportPath(), InsertObj(), and InsertTextObject().
|
private |
Definition at line 774 of file svdpdf.cxx.
References Point::AdjustY(), ALIGN_BASELINE, ALIGN_BOTTOM, FRound(), vcl::Font::GetAlignment(), FontMetric::GetAscent(), vcl::Font::GetAverageFontWidth(), vcl::Font::GetFillColor(), vcl::Font::GetOrientation(), Size::Height(), InsertObj(), vcl::Font::IsTransparent(), makeSdrTextAutoGrowHeightItem(), makeSdrTextAutoGrowWidthItem(), makeSdrTextLeftDistItem(), makeSdrTextLowerDistItem(), makeSdrTextRightDistItem(), makeSdrTextUpperDistItem(), maOfs, mfScaleX, mfScaleY, mnLayer, mpFillAttr, mpModel, mpVD, SfxItemSet::Put(), SDRATTR_TEXT_AUTOGROWWIDTH(), SetAttributes(), Text, Size::Width(), Point::X(), and Point::Y().
Referenced by ImportText().
|
private |
Definition at line 645 of file svdpdf.cxx.
References basegfx::B2DPolyPolygon::getB2DRange(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), and maClip.
Referenced by checkClip(), and InsertObj().
|
private |
Definition at line 832 of file svdpdf.cxx.
References MapMode::GetOrigin(), i, maTmpList, mnMapScalingOfs, mpVD, SdrObject::NbcMove(), nCount, Point::X(), and Point::Y().
Referenced by DoImport().
|
privatedelete |
|
private |
Convert PDF points to logic (twips).
Definition at line 1034 of file svdpdf.cxx.
References bottom, convertPointToMm100(), correctVertOrigin(), left, right, and top.
Referenced by ImportImage(), ImportPath(), and ImportText().
|
private |
Definition at line 1026 of file svdpdf.cxx.
References convertPointToMm100(), correctVertOrigin(), x, and y.
|
private |
Definition at line 273 of file svdpdf.cxx.
References EE_CHAR_COLOR(), EE_CHAR_FONTHEIGHT(), EE_CHAR_FONTHEIGHT_CJK(), EE_CHAR_FONTHEIGHT_CTL(), EE_CHAR_FONTINFO(), EE_CHAR_FONTINFO_CJK(), EE_CHAR_FONTINFO_CTL(), EE_CHAR_FONTWIDTH(), EE_CHAR_ITALIC(), EE_CHAR_OUTLINE(), EE_CHAR_OVERLINE(), EE_CHAR_SHADOW(), EE_CHAR_STRIKEOUT(), EE_CHAR_UNDERLINE(), EE_CHAR_WEIGHT(), EE_CHAR_WLM(), FRound(), gaLineCap, vcl::Font::GetCharSet(), XDash::GetDashes(), XDash::GetDashLen(), XDash::GetDistance(), XDash::GetDotLen(), XDash::GetDots(), vcl::Font::GetFamilyName(), vcl::Font::GetFamilyType(), vcl::Font::GetFontSize(), vcl::Font::GetItalic(), SdrObject::GetOutlinerParaObject(), vcl::Font::GetOverline(), vcl::Font::GetPitch(), vcl::Font::GetStrikeout(), vcl::Font::GetStyleName(), vcl::Font::GetUnderline(), vcl::Font::GetWeight(), Size::Height(), SdrObject::IsClosedObj(), vcl::Font::IsOutline(), vcl::Font::IsShadow(), vcl::Font::IsWordLineMode(), maDash, maOldLineColor, mbFntDirty, mbNoFill, mbNoLine, mfScaleY, mnLayer, mnLineWidth, mpFillAttr, mpLineAttr, mpTextAttr, mpVD, SDRTEXTHORZADJUST_LEFT, SdrObject::SetLayer(), SdrObject::SetMergedItem(), and SdrObject::SetMergedItemSet().
Referenced by CheckLastPolyLineAndFillMerge(), ImportPath(), and InsertTextObject().
|
private |
Definition at line 169 of file svdpdf.cxx.
References convertPointToMm100(), Fraction, tools::Rectangle::GetHeight(), tools::Rectangle::GetWidth(), Size::Height(), tools::Rectangle::IsEmpty(), maOfs, maScaleRect, maScaleX, maScaleY, mbMov, mbSize, mdPageHeightPts, mfScaleX, mfScaleY, tools::Rectangle::TopLeft(), Size::Width(), Point::X(), and Point::Y().
Referenced by DoObjects().
|
staticconstexprprivate |
Definition at line 60 of file svdpdf.hxx.
Referenced by SetAttributes().
|
private |
Definition at line 79 of file svdpdf.hxx.
Referenced by checkClip(), InsertObj(), and isClip().
|
private |
The current transformation matrix, typically used with Form objects.
Definition at line 85 of file svdpdf.hxx.
Referenced by ImportForm(), ImportPath(), and ImportText().
|
private |
Definition at line 61 of file svdpdf.hxx.
Referenced by SetAttributes().
|
private |
Definition at line 65 of file svdpdf.hxx.
Referenced by checkClip(), ImportPath(), InsertObj(), InsertTextObject(), and SetupPageScale().
|
private |
Definition at line 58 of file svdpdf.hxx.
Referenced by ImpSdrPdfImport(), and SetAttributes().
|
private |
Definition at line 51 of file svdpdf.hxx.
Referenced by InsertObj(), and SetupPageScale().
|
private |
Definition at line 68 of file svdpdf.hxx.
Referenced by InsertObj(), and SetupPageScale().
|
private |
Definition at line 69 of file svdpdf.hxx.
Referenced by InsertObj(), and SetupPageScale().
|
private |
Definition at line 49 of file svdpdf.hxx.
Referenced by CheckLastPolyLineAndFillMerge(), DoImport(), InsertObj(), and MapScaling().
|
private |
Definition at line 71 of file svdpdf.hxx.
Referenced by ImportText(), and SetAttributes().
|
private |
Definition at line 74 of file svdpdf.hxx.
Referenced by CheckLastPolyLineAndFillMerge(), ImportPath(), and InsertObj().
|
private |
Definition at line 63 of file svdpdf.hxx.
Referenced by InsertObj(), and SetupPageScale().
|
private |
Definition at line 76 of file svdpdf.hxx.
Referenced by CheckLastPolyLineAndFillMerge(), and SetAttributes().
|
private |
Definition at line 75 of file svdpdf.hxx.
Referenced by CheckLastPolyLineAndFillMerge(), InsertObj(), and SetAttributes().
|
private |
Definition at line 64 of file svdpdf.hxx.
Referenced by InsertObj(), and SetupPageScale().
|
private |
Definition at line 83 of file svdpdf.hxx.
Referenced by correctVertOrigin(), and SetupPageScale().
|
private |
Definition at line 66 of file svdpdf.hxx.
Referenced by checkClip(), ImportPath(), InsertTextObject(), and SetupPageScale().
|
private |
Definition at line 67 of file svdpdf.hxx.
Referenced by checkClip(), ImportPath(), InsertTextObject(), SetAttributes(), and SetupPageScale().
|
private |
Definition at line 57 of file svdpdf.hxx.
Referenced by InsertTextObject(), and SetAttributes().
|
private |
Definition at line 59 of file svdpdf.hxx.
Referenced by ImportPath(), and SetAttributes().
|
private |
Definition at line 52 of file svdpdf.hxx.
Referenced by MapScaling().
|
private |
Definition at line 82 of file svdpdf.hxx.
Referenced by GetPageCount(), and ImpSdrPdfImport().
|
private |
Definition at line 54 of file svdpdf.hxx.
Referenced by ImpSdrPdfImport(), InsertTextObject(), and SetAttributes().
|
private |
Definition at line 53 of file svdpdf.hxx.
Referenced by CheckLastPolyLineAndFillMerge(), ImpSdrPdfImport(), and SetAttributes().
|
private |
Definition at line 56 of file svdpdf.hxx.
Referenced by ImportImage(), ImportPath(), InsertObj(), and InsertTextObject().
|
private |
Definition at line 81 of file svdpdf.hxx.
Referenced by DoObjects(), and ImpSdrPdfImport().
|
private |
Definition at line 94 of file svdpdf.hxx.
Referenced by ImpSdrPdfImport().
|
private |
Definition at line 55 of file svdpdf.hxx.
Referenced by ImpSdrPdfImport(), and SetAttributes().
|
private |
Definition at line 50 of file svdpdf.hxx.
Referenced by checkClip(), ImportPath(), ImportText(), ImpSdrPdfImport(), InsertTextObject(), MapScaling(), and SetAttributes().