diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/ipdf/pdfread.cxx | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index 001303194259..a0e9b51e28a8 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -257,7 +257,8 @@ findAnnotations(const std::unique_ptr<vcl::pdf::PDFiumPage>& pPage, basegfx::B2D if (eSubtype == vcl::pdf::PDFAnnotationSubType::Text || eSubtype == vcl::pdf::PDFAnnotationSubType::Polygon || eSubtype == vcl::pdf::PDFAnnotationSubType::Circle - || eSubtype == vcl::pdf::PDFAnnotationSubType::Square) + || eSubtype == vcl::pdf::PDFAnnotationSubType::Square + || eSubtype == vcl::pdf::PDFAnnotationSubType::Ink) { OUString sAuthor = pAnnotation->getString(vcl::pdf::constDictionaryKeyTitle); OUString sText = pAnnotation->getString(vcl::pdf::constDictionaryKeyContents); @@ -326,6 +327,30 @@ findAnnotations(const std::unique_ptr<vcl::pdf::PDFiumPage>& pPage, basegfx::B2D if (pAnnotation->hasKey(vcl::pdf::constDictionaryKeyInteriorColor)) pMarker->maFillColor = pAnnotation->getInteriorColor(); } + else if (eSubtype == vcl::pdf::PDFAnnotationSubType::Ink) + { + auto const& rStrokesList = pAnnotation->getInkStrokes(); + if (!rStrokesList.empty()) + { + auto pMarker = std::make_shared<vcl::pdf::PDFAnnotationMarkerInk>(); + rPDFGraphicAnnotation.mpMarker = pMarker; + for (auto const& rStrokes : rStrokesList) + { + basegfx::B2DPolygon aPolygon; + for (auto const& rVertex : rStrokes) + { + double x = convertPointToMm100(rVertex.getX()); + double y = convertPointToMm100(aPageSize.getY() - rVertex.getY()); + aPolygon.append({ x, y }); + } + pMarker->maStrokes.push_back(aPolygon); + } + float fWidth = pAnnotation->getBorderWidth(); + pMarker->mnWidth = convertPointToMm100(fWidth); + if (pAnnotation->hasKey(vcl::pdf::constDictionaryKeyInteriorColor)) + pMarker->maFillColor = pAnnotation->getInteriorColor(); + } + } } } } |