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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PdfViewer.Objects.RemoveObject - edited PDF saved with collapsed structure

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
aleatprog Posted - Apr 18 2026 : 16:06:40
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
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 27 2026 : 22:01:38
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