diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-04-08 20:34:29 -0400 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-05-14 08:15:49 -0400 |
commit | f0f57ee532a8c7a361d7e8c0672a12457f6a437b (patch) | |
tree | 2c7ec327aa3e5eed586719d37ee02985d3743e20 | |
parent | e28ad2ff4d1384d6f4be83c897f8d2ed7a6807c7 (diff) |
svx: import PDF text using PDFium
Change-Id: I7c75477f5257931f5182b8d65e898857526bf555
-rw-r--r-- | external/pdfium/UnpackedTarball_pdfium.mk | 2 | ||||
-rw-r--r-- | external/pdfium/edit.patch.1 | 159 | ||||
-rw-r--r-- | sd/source/filter/pdf/sdpdffilter.cxx | 15 | ||||
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 138 | ||||
-rw-r--r-- | svx/source/svdraw/svdpdf.hxx | 4 |
5 files changed, 261 insertions, 57 deletions
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 333d06bb8e35..c917d63a4cdd 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -13,6 +13,8 @@ pdfium_patches += ubsan.patch pdfium_patches += freetype.patch.1 # Fixes build on our baseline. pdfium_patches += build.patch.1 +# Adds missing editing API +pdfium_patches += edit.patch.1 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium)) diff --git a/external/pdfium/edit.patch.1 b/external/pdfium/edit.patch.1 new file mode 100644 index 000000000000..78cf4c3394c6 --- /dev/null +++ b/external/pdfium/edit.patch.1 @@ -0,0 +1,159 @@ +diff --git a/core/fpdfapi/page/cpdf_imageobject.cpp b/core/fpdfapi/page/cpdf_imageobject.cpp +index 3b5a740..58ef90a 100644 +--- a/core/fpdfapi/page/cpdf_imageobject.cpp ++++ b/core/fpdfapi/page/cpdf_imageobject.cpp +@@ -43,6 +43,7 @@ const CPDF_ImageObject* CPDF_ImageObject::AsImage() const { + void CPDF_ImageObject::CalcBoundingBox() { + std::tie(m_Left, m_Right, m_Top, m_Bottom) = + m_Matrix.TransformRect(0.f, 1.f, 1.f, 0.f); ++ fprintf(stderr, "Image BB: %f, %f, %f, %f\n", m_Left, m_Right, m_Top, m_Bottom); + } + + void CPDF_ImageObject::SetImage(const RetainPtr<CPDF_Image>& pImage) { +diff --git a/core/fpdfapi/page/cpdf_pageobject.cpp b/core/fpdfapi/page/cpdf_pageobject.cpp +index 8bb5bf5..9b5e2ce 100644 +--- a/core/fpdfapi/page/cpdf_pageobject.cpp ++++ b/core/fpdfapi/page/cpdf_pageobject.cpp +@@ -98,5 +98,7 @@ FX_RECT CPDF_PageObject::GetBBox(const CFX_Matrix* pMatrix) const { + if (pMatrix) + rect = pMatrix->TransformRect(rect); + ++ FX_RECT rc = rect.GetOuterRect(); ++ fprintf(stderr, "PageObject BB: %f, %f, %f, %f\n", rc.left, rc.right, rc.top, rc.bottom); + return rect.GetOuterRect(); + } +diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp +index 0a01ae0..fad2920 100644 +--- a/core/fpdfapi/render/cpdf_renderstatus.cpp ++++ b/core/fpdfapi/render/cpdf_renderstatus.cpp +@@ -1793,6 +1793,7 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, + return true; + + float font_size = textobj->m_TextState.GetFontSize(); ++ fprintf(stderr, "Font size: %f, matrix a: %f, b: %f, c: %f, d: %f, e: %f, f: %f\n", font_size, text_matrix.a, text_matrix.b, text_matrix.c, text_matrix.d, text_matrix.e, text_matrix.f); + if (bPattern) { + DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, + &text_matrix, bFill, bStroke); +diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp +index ca2cf3f..ef4b958 100644 +--- a/fpdfsdk/fpdfeditpage.cpp ++++ b/fpdfsdk/fpdfeditpage.cpp +@@ -17,6 +17,7 @@ + #include "core/fpdfapi/page/cpdf_page.h" + #include "core/fpdfapi/page/cpdf_pageobject.h" + #include "core/fpdfapi/page/cpdf_pathobject.h" ++#include "core/fpdfapi/page/cpdf_textobject.h" + #include "core/fpdfapi/page/cpdf_shadingobject.h" + #include "core/fpdfapi/parser/cpdf_array.h" + #include "core/fpdfapi/parser/cpdf_document.h" +@@ -363,3 +364,20 @@ FPDFPageObj_GetBounds(FPDF_PAGEOBJECT pageObject, + *top = bbox.top; + return true; + } ++ ++FPDF_EXPORT void FPDF_CALLCONV ++FPDFTextObj_GetMatrix(FPDF_PAGEOBJECT text_object, ++ double* a, ++ double* b, ++ double* c, ++ double* d) { ++ if (!text_object) ++ return; ++ ++ CPDF_TextObject* pTxtObj = static_cast<CPDF_TextObject*>(text_object); ++ const CFX_Matrix& matrix = pTxtObj->GetTextMatrix(); ++ *a = matrix.a; ++ *b = matrix.b; ++ *c = matrix.c; ++ *d = matrix.d; ++} +diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp +index 68bf4f8..e073b20 100644 +--- a/fpdfsdk/fpdftext.cpp ++++ b/fpdfsdk/fpdftext.cpp +@@ -105,6 +105,28 @@ FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, + return charinfo.m_FontSize; + } + ++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetMatrix(FPDF_TEXTPAGE text_page, ++ int index, ++ double* a, ++ double* b, ++ double* c, ++ double* d) { ++ if (!text_page || index < 0) ++ return false; ++ ++ CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page); ++ if (index >= textpage->CountChars()) ++ return false; ++ ++ FPDF_CHAR_INFO charinfo; ++ textpage->GetCharInfo(index, &charinfo); ++ *a = charinfo.m_Matrix.a; ++ *b = charinfo.m_Matrix.b; ++ *c = charinfo.m_Matrix.c; ++ *d = charinfo.m_Matrix.d; ++ return true; ++} ++ + FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, + int index, + double* left, +diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h +index 54735a3..3642a2a 100644 +--- a/public/fpdf_edit.h ++++ b/public/fpdf_edit.h +@@ -761,6 +761,21 @@ FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document, + FPDF_FONT font, + float font_size); + ++// Get the matrix of a particular text object. ++// ++// text_object - Handle of text object returned by FPDFPageObj_NewTextObj ++// or FPDFPageObj_NewTextObjEx. ++// a - Pointer to a double value receiving coefficient "a" of the matrix. ++// b - Pointer to a double value receiving coefficient "b" of the matrix. ++// c - Pointer to a double value receiving coefficient "c" of the matrix. ++// d - Pointer to a double value receiving coefficient "d" of the matrix. ++FPDF_EXPORT void FPDF_CALLCONV ++FPDFTextObj_GetMatrix(FPDF_PAGEOBJECT text_object, ++ double* a, ++ double* b, ++ double* c, ++ double* d); ++ + #ifdef __cplusplus + } // extern "C" + #endif // __cplusplus +diff --git a/public/fpdf_text.h b/public/fpdf_text.h +index 043dc16..fe3b971 100644 +--- a/public/fpdf_text.h ++++ b/public/fpdf_text.h +@@ -342,6 +342,26 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle); + // + FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle); + ++// Get the matrix of a particular character. ++// ++// text_page - Handle to a text page information structure. ++// Returned by FPDFText_LoadPage function. ++// index - Zero-based index of the character ++// a - Pointer to a double value receiving coefficient "a" of the matrix. ++// b - Pointer to a double value receiving coefficient "b" of the matrix. ++// c - Pointer to a double value receiving coefficient "c" of the matrix. ++// d - Pointer to a double value receiving coefficient "d" of the matrix. ++// ++// Return Value: ++// On success, return TRUE and fill in |a|, |b|, |c|, and |d| ++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV ++FPDFText_GetMatrix(FPDF_TEXTPAGE text_page, ++ int index, ++ double* a, ++ double* b, ++ double* c, ++ double* d); ++ + // Function: FPDFLink_LoadWebLinks + // Prepare information about weblinks in a page. + // Parameters: diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index c96e2dfd616c..ee2185f0ed3d 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -129,11 +129,13 @@ bool SdPdfFilter::Import() // Create the page and insert the Graphic. SdPage* pPage = mrDocument.GetSdPage(nPageNumber++, PageKind::Standard); - Point aPos; - Size aPagSize(pPage->GetSize()); + + SAL_WARN("sd.filter", "Graphic PrefSize: " << aGraphic.GetPrefSize()); Size aGrfSize(OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM))); + SAL_WARN("sd.filter", "Graphic Logic Size: " << aGrfSize); + Size aPagSize(pPage->GetSize()); aPagSize.AdjustWidth(-(pPage->GetLeftBorder() + pPage->GetRightBorder())); aPagSize.AdjustHeight(-(pPage->GetUpperBorder() + pPage->GetLowerBorder())); @@ -141,8 +143,8 @@ bool SdPdfFilter::Import() if (((aGrfSize.Height() > aPagSize.Height()) || (aGrfSize.Width() > aPagSize.Width())) && aGrfSize.Height() && aPagSize.Height()) { - double fGrfWH = static_cast<double>(aGrfSize.Width()) / aGrfSize.Height(); - double fWinWH = static_cast<double>(aPagSize.Width()) / aPagSize.Height(); + const double fGrfWH = static_cast<double>(aGrfSize.Width()) / aGrfSize.Height(); + const double fWinWH = static_cast<double>(aPagSize.Width()) / aPagSize.Height(); // adjust graphic to page size (scales) if (fGrfWH < fWinWH) @@ -157,10 +159,13 @@ bool SdPdfFilter::Import() } } - // set output rectangle for graphic + // Set the output rectangle of the Graphic. + Point aPos; aPos.setX(((aPagSize.Width() - aGrfSize.Width()) >> 1) + pPage->GetLeftBorder()); aPos.setY(((aPagSize.Height() - aGrfSize.Height()) >> 1) + pPage->GetUpperBorder()); + SAL_WARN("sd.filter", "Graphic Pos: " << aPos); + SAL_WARN("sd.filter", "Graphic Logic Size: " << aGrfSize); pPage->InsertObject(new SdrGrafObj(aGraphic, Rectangle(aPos, aGrfSize))); } diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index fc11783183ad..85bb13b86480 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -253,35 +253,45 @@ void ImpSdrPdfImport::DoLoopActions(SvdProgressInfo* pProgrInfo, sal_uInt32* pAc } } - /* // Now do the text. FPDF_TEXTPAGE pTextPage = FPDFText_LoadPage(pPdfPage); if (pTextPage != nullptr) { + SAL_WARN("sd.filter", "TEXT TEXT TEXT"); + const int nChars = FPDFText_CountChars(pTextPage); SAL_WARN("sd.filter", "Got page chars: " << nChars); const int nRects = FPDFText_CountRects(pTextPage, 0, nChars); SAL_WARN("sd.filter", "Got Rects: " << nRects); - std::unique_ptr<sal_Unicode[]> pText(new sal_Unicode[nChars]); + std::unique_ptr<sal_Unicode[]> pText(new sal_Unicode[nChars + 1]); // + terminating null for (int nRectIndex = 0; nRectIndex < nRects; ++nRectIndex) { + SAL_WARN("sd.filter", + "Processing Text Rect #" << nRectIndex + 1 << " of " << nRects); + double left = 0; double top = 0; double right = 0; double bottom = 0; FPDFText_GetRect(pTextPage, nRectIndex, &left, &top, &right, &bottom); + SAL_WARN("sd.filter", "Got Text Rect: " << left << ", " << right << ", " << top + << ", " << bottom); + Rectangle aRect = PointsToLogic(left, right, top, bottom); + if (right < left) std::swap(right, left); if (bottom < top) std::swap(bottom, top); - SAL_WARN("sd.filter", "Got Text Rect: " << left << ", " << top << ", " << right + SAL_WARN("sd.filter", "Got Text Rect: " << left << ", " << right << ", " << top << ", " << bottom); - const int nBoundedChars = FPDFText_GetBoundedText( - pTextPage, left, top, right, bottom, - reinterpret_cast<unsigned short*>(pText.get()), nChars); + SAL_WARN("sd.filter", "Logic Text Rect: " << aRect); + + unsigned short* pShortText = reinterpret_cast<unsigned short*>(pText.get()); + const int nBoundedChars = FPDFText_GetBoundedText(pTextPage, left, top, right, + bottom, pShortText, nChars); OUString sText(pText.get(), nBoundedChars); SAL_WARN("sd.filter", "Got Text #" << nRectIndex + 1 << " (" << nBoundedChars << "): [" << sText << "]."); @@ -304,8 +314,34 @@ void ImpSdrPdfImport::DoLoopActions(SvdProgressInfo* pProgrInfo, sal_uInt32* pAc // aFontMetric.SetAscent(nFontAscent); // aFontMetric.SetDescent(nFontDescent); - const double dFontSize = FPDFText_GetFontSize(pTextPage, nCharIndex) * 140; + double dFontScale = 1.0; + geometry::Matrix2D aMatrix; + if (!FPDFText_GetMatrix(pTextPage, nCharIndex, &aMatrix.m00, &aMatrix.m01, + &aMatrix.m10, &aMatrix.m11)) + { + SAL_WARN("sd.filter", "No font scale matrix, will use heuristic height of " + << aRect.GetHeight() << "."); + dFontScale = aRect.GetHeight(); + } + else if (aMatrix.m00 != aMatrix.m11 || aMatrix.m00 <= 0) + { + SAL_WARN("sd.filter", "Bogus font scale matrix (" + << aMatrix.m00 << ',' << aMatrix.m11 + << "), will use heuristic height of " + << aRect.GetHeight() << "."); + dFontScale = aRect.GetHeight(); + } + else + dFontScale = aMatrix.m00; + + double dFontSize = FPDFText_GetFontSize(pTextPage, nCharIndex); SAL_WARN("sd.filter", "Got Font Size: " << dFontSize); + dFontSize *= dFontScale; + SAL_WARN("sd.filter", "Got Font Size Scaled: " << dFontSize); + dFontSize = lcl_PointToPixel(dFontSize); + SAL_WARN("sd.filter", "Got Font Pixel Size: " << dFontSize); + dFontSize = lcl_ToLogic(dFontSize); + SAL_WARN("sd.filter", "Got Font Logic Size: " << dFontSize); vcl::Font aFnt = mpVD->GetFont(); aFnt.SetFontSize(Size(dFontSize, dFontSize)); mpVD->SetFont(aFnt); @@ -314,6 +350,9 @@ void ImpSdrPdfImport::DoLoopActions(SvdProgressInfo* pProgrInfo, sal_uInt32* pAc double y = 0; FPDFText_GetCharOrigin(pTextPage, nCharIndex, &x, &y); SAL_WARN("sd.filter", "Got Char Origin: " << x << ", " << y); + Point aPos = PointsToLogic(x, y); + SAL_WARN("sd.filter", "Got Char Origin Logic: " << aPos); + // aRect.Move(aPos.X(), aPos.Y()); // geometry::RealRectangle2D aRect; // aRect.X1 = left; @@ -359,14 +398,13 @@ void ImpSdrPdfImport::DoLoopActions(SvdProgressInfo* pProgrInfo, sal_uInt32* pAc // double charWidth = offsetMatrix2.get(0, 2); // double prevSpaceWidth = offsetMatrix1.get(0, 2) - prevCharWidth; - ImportText(Point(x, y), sText); + ImportText(aRect.TopLeft(), sText); } FPDFText_ClosePage(pTextPage); } FPDF_ClosePage(pPdfPage); -*/ } // const sal_uLong nCount(rMtf.GetActionSize()); @@ -985,6 +1023,7 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const OUString& rStr) Point aPos(FRound(rPos.X() * mfScaleX + maOfs.X()), FRound(rPos.Y() * mfScaleY + maOfs.Y())); Size aSize(nTextWidth, nTextHeight); + SAL_WARN("sd.filter", "Text Pos: " << aPos << ", Size: " << aSize); if (eAlg == ALIGN_BASELINE) aPos.Y() -= FRound(aFontMetric.GetAscent() * mfScaleY); @@ -992,6 +1031,7 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const OUString& rStr) aPos.Y() -= nTextHeight; Rectangle aTextRect(aPos, aSize); + SAL_WARN("sd.filter", "Text Rect: " << aTextRect); SdrRectObj* pText = new SdrRectObj(OBJ_TEXT, aTextRect); pText->SetMergedItem(makeSdrTextUpperDistItem(0)); @@ -1134,11 +1174,41 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject) SAL_WARN("sd.filter", "Got IMAGE bounds left: " << left << ", right: " << right << ", top: " << top << ", bottom: " << bottom); + Rectangle aRect = PointsToLogic(left, right, top, bottom); + aRect.MoveRight(1); + aRect.MoveBottom(1); + SAL_WARN("sd.filter", "IMAGE Logical Rect FINAL: " << aRect); + + SdrGrafObj* pGraf = new SdrGrafObj(Graphic(aBitmap), aRect); + + // This action is not creating line and fill, set directly, do not use SetAttributes(..) + pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE)); + pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE)); + InsertObj(pGraf); +} + +Point ImpSdrPdfImport::PointsToLogic(double x, double y) const +{ + y = correctVertOrigin(y); + SAL_WARN("sd.filter", "Corrected point x: " << x << ", y: " << y); + x = lcl_PointToPixel(x); + y = lcl_PointToPixel(y); + + SAL_WARN("sd.filter", "Pixel point x: " << x << ", y: " << y); + + Point aPos(lcl_ToLogic(x), lcl_ToLogic(y)); + SAL_WARN("sd.filter", "Logical Pos: " << aPos); + + return aPos; +} + +Rectangle ImpSdrPdfImport::PointsToLogic(double left, double right, double top, + double bottom) const +{ top = correctVertOrigin(top); bottom = correctVertOrigin(bottom); - SAL_WARN("sd.filter", "IMAGE corrected bounds left: " << left << ", right: " << right - << ", top: " << top - << ", bottom: " << bottom); + SAL_WARN("sd.filter", "Corrected bounds left: " << left << ", right: " << right + << ", top: " << top << ", bottom: " << bottom); left = lcl_PointToPixel(left); right = lcl_PointToPixel(right); top = lcl_PointToPixel(top); @@ -1148,51 +1218,15 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject) // if (left > right) // std::swap(left, right); - SAL_WARN("sd.filter", "IMAGE pixel bounds left: " << left << ", right: " << right << ", top: " - << top << ", bottom: " << bottom); + SAL_WARN("sd.filter", "Pixel bounds left: " << left << ", right: " << right << ", top: " << top + << ", bottom: " << bottom); Point aPos(lcl_ToLogic(left), lcl_ToLogic(top)); Size aSize(lcl_ToLogic(right - left), lcl_ToLogic(bottom - top)); Rectangle aRect(aPos, aSize); - SAL_WARN("sd.filter", "IMAGE Logical BBox: " << aRect); - - // aRect.SetLeft(aRect.Left() * mfScaleX); - // aRect.SetRight(aRect.Right() * mfScaleX); - // aRect.SetTop(aRect.Top() * mfScaleY); - // aRect.SetBottom(aRect.Bottom() * mfScaleY); - // SAL_WARN("sd.filter", "Logical Rect Scaled: " << aRect); + SAL_WARN("sd.filter", "Logical BBox: " << aRect); - // aLogRect.Move(maScaleRect.Left(), maScaleRect.Top() - aLogRect.Top()); - // aRect.Move(maScaleRect.Left(), maScaleRect.Top()); - // SAL_WARN("sd.filter", "Logical Rect Absolute: " << aRect); - aRect.MoveRight(1); - aRect.MoveBottom(1); - SAL_WARN("sd.filter", "IMAGE Logical Rect FINAL: " << aRect); - - /* - Size aGrfSize(OutputDevice::LogicToLogic(Size(nWidth, nHeight), aBitmap.GetPrefMapMode(), - MapMode(MapUnit::Map100thMM))); - SAL_WARN("sd.filter", "Logical Size: " << aGrfSize); - // SAL_WARN("sd.filter", "Scaled Logical Size: " << aGrfSize); - Point aGrfPos(OutputDevice::LogicToLogic(Point(left, top), aBitmap.GetPrefMapMode(), - MapMode(MapUnit::Map100thMM))); - SAL_WARN("sd.filter", "Logical Pos: " << aGrfPos); - - SAL_WARN("sd.filter", "Page Logical Height: " << maScaleRect.GetHeight()); - const auto realTop = maScaleRect.GetHeight() - aGrfPos.Y(); - SAL_WARN("sd.filter", "Real Logical Top Offset: " << realTop); - aGrfPos.Move(maScaleRect.Left(), maScaleRect.Top() - aGrfPos.Y()); - SAL_WARN("sd.filter", "Adjusted Logical Pos: " << aGrfPos); - - Rectangle aRect(aGrfPos, aGrfSize); - SAL_WARN("sd.filter", "Got IMAGE Logical BBox: " << aRect); -*/ - SdrGrafObj* pGraf = new SdrGrafObj(Graphic(aBitmap), aRect); - - // This action is not creating line and fill, set directly, do not use SetAttributes(..) - pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE)); - pGraf->SetMergedItem(XFillStyleItem(drawing::FillStyle_NONE)); - InsertObj(pGraf); + return aRect; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdpdf.hxx b/svx/source/svdraw/svdpdf.hxx index 178bd3074343..70d22cd26c51 100644 --- a/svx/source/svdraw/svdpdf.hxx +++ b/svx/source/svdraw/svdpdf.hxx @@ -92,6 +92,10 @@ class ImpSdrPdfImport final /// PDF coordinate system has orign at the bottom right. double correctVertOrigin(double offsetPts) const { return mdPageHeightPts - offsetPts; } + /// Convert PDF points to logic (twips). + Rectangle PointsToLogic(double left, double right, double top, double bottom) const; + Point PointsToLogic(double x, double y) const; + // check for clip and evtl. fill maClip void checkClip(); bool isClip() const; |