Rank: Member
Groups: Registered
Joined: 7/26/2016(UTC) Posts: 25  Location: Somerset Thanks: 5 times
|
Hi,
What is the correct way to completely remove an indirect object from a PDF?
My specific problem is that I have an AcroForm field dictionary that contains an entry with key 'Metadata' which is an indirect stream object. However, I can find no way to delete the object so that it is completely removed from the PDF.
If the field dictionary is 'fieldDictionary', I can get the value of the 'Metadata' key with:
PdfTypeIndirect metadataObj = fieldDictionary.GetBy("Metadata") as PdfTypeIndirect;
I have tried calling:
metadataObj.Release(); metadataObj.Direct.Release(); PdfIndirectList.FromPdfDocument(pdfDoc).Remove(metadataObj.ObjectNumber); fieldDictionary.Remove("Metadata");
and variations of the above, but nothing seems to work. When I save the PDF and look at its contents in a text editor the metadata object is always still present as an 'orphaned' unreferenced object. For our application we need to completely remove the object even though it is not referenced by any other object in the PDF.
Any help would be greatly appreciated. Thanks.
Regards, Terry.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Originally Posted by: Terry  When I save the PDF and look at its contents in a text editor the metadata object is always still present as an 'orphaned' unreferenced object. Do you save it with NoIncrement flag? Could you please provide that pdf file and point me what I should delete and how I can check result?
|
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 7/26/2016(UTC) Posts: 25  Location: Somerset Thanks: 5 times
|
Hi Paul,
Thanks for your reply.
Yes, I do save the PDF with the ‘NoIncremental’ flag.
I am just sending you an email with an example PDF attached and more details of the problem.
Many thanks for your help.
Best regards, Terry.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
|
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close