Add the functions of the previous and next steps

103 views
Skip to first unread message

吴吴

unread,
Jan 14, 2025, 8:56:21 PM1/14/25
to pdfium
I am considering adding a undo function to the pdfium editing function. However, when I use pdfium editing, I cannot return to the previous page after adding an object, and I do not know how to proceed

Lei Zhang

unread,
Jan 16, 2025, 9:49:34 PM1/16/25
to 吴吴, pdfium
PDFium does not have built-in support for this. For example, if the
embedder's code added an object, it needs to delete the object to
achieve the undo, or use the recently added FPDFPageObj_SetIsActive()
to mark the object as "inactive" which will make PDFium ignore it.

On Tue, Jan 14, 2025 at 5:56 PM 吴吴 <a1870...@gmail.com> wrote:
>
> I am considering adding a undo function to the pdfium editing function. However, when I use pdfium editing, I cannot return to the previous page after adding an object, and I do not know how to proceed
>
> --
> 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/d296a0ac-fba2-4fb4-9779-16838dbfbe66n%40googlegroups.com.

吴吴

unread,
Jan 17, 2025, 2:28:08 AM1/17/25
to pdfium
将来会直接支持吊销功能吗?undo canundo Redo canredo,另外,将来是否支持 FPDFPage_insertObject API 将对象插入到指定的索引中?

Lei Zhang

unread,
Jan 17, 2025, 6:57:37 PM1/17/25
to 吴吴, pdfium
> Will the revocation function be directly supported in the future? undo canundo Redo canredo, Also, will the FPDFPage_insertObject API be supported in the future to insert an object into the specified index?

Probably not? If it is supported, then it would need to be optional,
as maintaining an undo stack can be costly in terms of complexity and
resources required.

FPDFPage_InsertObject(), which is a separate topic, is tracked in
https://crbug.com/389726697 that you filed.
> To view this discussion visit https://groups.google.com/d/msgid/pdfium/925a1a55-3fca-4918-a908-f9d4189321f7n%40googlegroups.com.

吴吴

unread,
Feb 13, 2025, 10:54:20 PM2/13/25
to pdfium

I  submitted the topic FPDFPage_insertObject (), but no one is managing this issue, and I don't know how to solve it. However, I believe that if we use the pdfium library for PDF editing projects, it is necessary to implement this API, which can help many people
Reply all
Reply to author
Forward
0 new messages