[EMAIL PROTECTED] wrote: > Dear Dominik, > I am using podofo and doing something to change the content of a pdf file. > I can get the objects in a pdf now and I want to change the object number of > the objects. But I found that the PdfObject::Reference() is a const > function. So how shall I make it? And, if I have changed the object number, > is there a simple way to make the pdf still self-contained? > Thank you.
When you change the object number, you must also find and update any references to that object number from elsewhere in the PDF. It's really an operation on the whole document rather than a single object. You will probably want to create a new PdfObject with the required object number and set its initial value to the source PdfObject (actually, it's variant). If it has a stream, you must separately copy the stream. The PdfDocument::Append(...) method does part of what you want. It's written to be efficient when renumbering a large number of objects, rather than just one, though. It does use PdfVecObjects innards, though, so be very careful (maybe we need to provide a safer public interface for this sort of thing?). -- Craig Ringer ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
