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.SaveToFile - wrong z-index

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 21 2026 : 08:49:14
Hello,

after executing the following code, ImageEnView1.PdfViewer visualizes correctly yellow rectangles under all search results, meanwhile in the exported PDF file, the yellow rectangles are above the search results, not highlighting but covering them.

ImageEnView1.PdfViewer.Enabled := True;
ImageEnView1.PdfViewer.AllowObjectEditing := True;
ImageEnView1.PdfViewer.LoadFromFile(Path + 'input.pdf');
for i := 0 to ImageEnView1.PdfViewer.PageCount - 1 do
  begin
    ImageEnView1.PdfViewer.PageIndex := i;
    if ImageEnView1.PdfViewer.Find(SearchBox.Text, wordIdx, wordLen, False, False, False, False) then
      begin
        rectArray := ImageEnView1.PDFViewer.GetTextRects(wordIdx, wordLen, 3, False);
        ImageEnView1.PdfViewer.FindNext(wordIdx, wordLen, False, False);
        rectArray := rectArray + ImageEnView1.PDFViewer.GetTextRects(wordIdx, wordLen, 3, False);
        for j := 0 to High(rectArray) do
          begin
            rect := rectArray[j];
            ImageEnView1.PdfViewer.Objects.AddRect(rect.Left, rect.Top, rect.Width, rect.Height, clYellow, 1.0, 1.0, True, clYellow, 1.0, True, 0);
          end;
        ImageEnView1.PdfViewer.ApplyChanges();
      end;
  end;
ImageEnView1.PdfViewer.SaveToFile(Path + 'output.pdf');


Like in topic "PdfViewer.Objects.RemoveObject - edited PDF saved with collapsed structure", also in this case the wrong visualisation (rectangle above text) becomes permanent in ImageEnView1.PdfViewer by loading another page.

Ale
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 27 2026 : 22:57:27
Hi Ale

Unfortunately that seems to be an issue in the way the PDFium library renders pending object changes. If you add:
ImageEnView1.PdfViewer.ReloadPage();

After:
ImageEnView1.PdfViewer.ApplyChanges();

It renders as per the final output.


Nigel
Xequte Software
www.imageen.com