Skip to content

Can I draw a rectangle? #160

Answered by mara004
carecavoador asked this question in Q&A
Nov 14, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

There are no helper methods for it yet, but I think it can be done with the raw API (though I haven't tried this myself yet). FPDFPageObj_CreateNewRect() and FPDFPageObj_SetFillColor() should do the trick. Take a look at fpdf_edit.h.

Also note that the current insert_text() method has problems and will be removed or replaced with something simpler on the next major release. It currently attempts to insert text using an external text shaping engine (for foreign writing systems) but that is quite complex and the implementation has issues. As long as you don't need to support Hindi etc., you're better off with FPDFPageObj_NewTextObj() (or FPDFPageObj_CreateTextObj()) and FPDFText_SetText() u…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@carecavoador
Comment options

@mara004
Comment options

Answer selected by carecavoador
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants