From 42afb017a64ffcc89f670df5f5a0d42a6e710b20 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Tue, 5 Jun 2018 11:30:22 +0200 Subject: [PATCH 05/14] svx: support Paths in PDFs while importing --- pdfium/fpdfsdk/fpdf_editpath.cpp | 10 ++++++++++ pdfium/public/fpdf_edit.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/pdfium/fpdfsdk/fpdf_editpath.cpp b/pdfium/fpdfsdk/fpdf_editpath.cpp index aca2beb..55f9fce 100644 --- a/pdfium/fpdfsdk/fpdf_editpath.cpp +++ b/pdfium/fpdfsdk/fpdf_editpath.cpp @@ -117,6 +117,16 @@ FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width) { return true; } +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_GetStrokeWidth(FPDF_PAGEOBJECT path, float* width) { + auto* pPathObj = CPDFPathObjectFromFPDFPageObject(path); + if (!pPathObj || !width) + return false; + + *width = pPathObj->m_GraphState.GetLineWidth(); + return true; +} + FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetFillColor(FPDF_PAGEOBJECT path, unsigned int R, unsigned int G, diff --git a/pdfium/public/fpdf_edit.h b/pdfium/public/fpdf_edit.h index fa9902e..b44bc71 100644 --- a/pdfium/public/fpdf_edit.h +++ b/pdfium/public/fpdf_edit.h @@ -678,6 +678,15 @@ FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width); FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObj_SetStrokeWidth(FPDF_PAGEOBJECT page_object, float width); +// Get the stroke width of a path. +// +// path - the handle to the path object. +// width - the width of the stroke. +// +// Returns TRUE on success +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_GetStrokeWidth(FPDF_PAGEOBJECT path, float* width); + // Set the line join of |page_object|. // // page_object - handle to a page object. -- 2.16.3