PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 1:14 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: delete all Text-Objects
PostPosted: Wed Jul 09, 2008 3:57 pm 
Offline

Joined: Wed Jul 09, 2008 3:52 pm
Posts: 3
Hello,

I'am new here.
How can I delete all Text-Objects from a PDF-Page with PDFSharp :?: ?

met


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jul 21, 2008 4:39 pm 
Offline

Joined: Mon Jul 21, 2008 4:20 pm
Posts: 4
If someone knows the answer would be a great help:
I'm trying to remove an image using this code

PdfDictionary resources = document.Pages[page].Elements.GetDictionary("/Resources");
PdfDictionary xObjects = resources.Elements.GetDictionary("/XObject");
...find the key of the image to delete...
xObjects.Elements.Remove(key);

When opening the document Adobe Reader says
"Could not find the XObject named '/XXX'
where XXX is the key of the XObject I removed.

Why does Adobe Reader search that element if I deleted it.

Workaround:
I tried to remove (or even simply damage) the stream of that XObject, that works fine but is not that great solution to the problem.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 430 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group