Is it possible to create Line and Watermark annotation into pdf?

40 views
Skip to first unread message

Loc Zhang (上杉夏香)

unread,
Sep 26, 2025, 3:55:47 AMSep 26
to pdfium
When I call FPDFPage_CreateAnnot to create line and watermark annotation, I get an error.

And I see FPDFAnnot_IsSupportedSubtype 
```c
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype) {
// The supported subtypes must also be communicated in the user doc.
switch (subtype) {
case FPDF_ANNOT_CIRCLE:
case FPDF_ANNOT_FILEATTACHMENT:
case FPDF_ANNOT_FREETEXT:
case FPDF_ANNOT_HIGHLIGHT:
case FPDF_ANNOT_INK:
case FPDF_ANNOT_LINK:
case FPDF_ANNOT_POPUP:
case FPDF_ANNOT_SQUARE:
case FPDF_ANNOT_SQUIGGLY:
case FPDF_ANNOT_STAMP:
case FPDF_ANNOT_STRIKEOUT:
case FPDF_ANNOT_TEXT:
case FPDF_ANNOT_UNDERLINE:
return true;
default:
return false;
}
}
```

There is no way use pdfium to create annotation like line?

Lei Zhang

unread,
Oct 15, 2025, 3:24:34 PMOct 15
to Loc Zhang (上杉夏香), pdfium
Please add this as 2 separate feature requests on the bug tracker:
https://crbug.com/pdfium/new, one for each annotation sub-type.

Is it possible? Yes. But someone has to do the work and teach PDFium
how to generate the appropriate annotation dictionary fields for each
annotation sub-type.
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/pdfium/ec00a31b-c7c8-490a-84e5-38ebe2d01112n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages