ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PdfViewer.Objects.RemoveObject - edited PDF saved with collapsed structure
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

149 Posts

Posted - Apr 18 2026 :  16:06:40  Show Profile  Reply
Hi,

I tried the following approaches to remove a portion of text from a PDF document:

1.)
ImageEnView1.PdfViewer.Objects.RemoveObject(i);
ImageEnView1.PdfViewer.ApplyChanges();
ImageEnView1.PdfViewer.SaveToFile(Path);


2.)
ImageEnView1.PdfViewer.Objects[i].Text := '';
ImageEnView1.PdfViewer.ApplyChanges();
ImageEnView1.PdfViewer.SaveToFile(Path);


In both cases, the table-like structure of the saved document collapsed, meanwhile ImageEnView1.PdfViewer correctly shows the edited PDF document.

Processing a document with multiple pages, ImageEnView.PdfViewer correctly shows the edited page until another page is loaded. If an ImageEnMView1 is attached, the thumbnails of all pages except the last shows the collapsed layout.

Attached images:
- Original PDF before removing
- PDF saved by ImageEnView.PdfViewer (text replaced by yellow rectangle for better understanding)
- ImageEn.PdfViewer showing correctly the edited PDF

Any ideas how to avoid the collapsing of the structure?

Thank you in advance,
Ale

attach/aleatprog/2026418161349_1.jpg

attach/aleatprog/2026418161418_3.jpg

attach/aleatprog/202641816146_2.jpg

xequte

39397 Posts

Posted - Apr 27 2026 :  22:01:38  Show Profile  Reply
Hi Ale

Sorry, can you give me specific steps to reproduce this. This is what I tried:

1. Run the PDFPageObjects demo
2. Open the PDF file you sent "test order.pdf"
3. Select a text object and remove it (or set text to '')
4. Apply Changes and save to a new PDF

In all cases, the content remains valid.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: