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