From 49058400ea8ddf753010dc73e7d381b7a35993ae Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 14 Feb 2017 18:26:20 -0500 Subject: Add public API for adding text with standard fonts BUG=pdfium:667 Change-Id: I05e301385a7af4b6ce27dc0b885e23646abf3dd9 Reviewed-on: https://pdfium-review.googlesource.com/2711 Commit-Queue: dsinclair Reviewed-by: Tom Sepez Reviewed-by: dsinclair --- public/fpdf_edit.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'public/fpdf_edit.h') diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index a43d181c81..c8d7a44c8e 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -386,6 +386,26 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, int fillmode, FPDF_BOOL stroke); +// Create a new text object using one of the standard PDF fonts. +// +// document - handle to the document. +// font - string containing the font name, without spaces. +// font_size - the font size for the new text object. +// +// Returns a handle to a new text object, or NULL on failure +DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, + FPDF_BYTESTRING font, + float font_size); + +// Set the text for a textobject. If it had text, it will be replaced. +// +// text_object - handle to the text object. +// text - string containing the text to be added. +// +// Returns TRUE on success +DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetText(FPDF_PAGEOBJECT text_object, + FPDF_BYTESTRING text); + #ifdef __cplusplus } // extern "C" #endif // __cplusplus -- cgit v1.2.3