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.ImportPages + ImageEnMView.SelectedImage
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

125 Posts

Posted - May 19 2021 :  01:44:40  Show Profile  Reply
Hi,

with AttachedImageEnView set, ImageEnView.PdfViewer.ImportPages correctly adds thumbnails in ImageEnMView. But meanwhile the selected thumbnail remains unaltered, the value of ImageEnMView.SelectedImage changes to the last idx.

Example:

Before ImportPages:
ImageEnView.PdfViewer.PageCount = 2
ImageEnMView.SelectedImage = 0
ImageEnMView highlighted thumbnail = 0

Atfer ImportPages:
ImageEnView.PdfViewer.PageCount = 7
ImageEnMView.SelectedImage = 6
ImageEnMView highlighted thumbnail = 0

Al

xequte

38222 Posts

Posted - May 27 2021 :  20:38:20  Show Profile  Reply
Hi

Yes, this is resolved in 10.0.2. You can email me for it.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

tiagosis

Brazil
36 Posts

Posted - Sep 24 2021 :  14:38:09  Show Profile  Reply
when I try to use streamed import, "PDF DOCUMENT IS NOT OPEN"

ImageEnView3.PdfViewer.ImportPages(stream2,ImageEnView1.PdfViewer.PageCount);

tiago
Go to Top of Page

xequte

38222 Posts

Posted - Sep 24 2021 :  21:54:42  Show Profile  Reply
Hi Tiago

This works fine for me:

  // Import all pages from a stream
  fs := TFileStream.Create('d:\test.pdf', fmOpenRead);
  try
    fs.Seek(0, soEnd);
    fs.Position := 0;
    ImageEnView1.PdfViewer.ImportPages( fs, '', ImageEnView1.PdfViewer.PageCount );
  finally
    fs.Free;
  end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

tiagosis

Brazil
36 Posts

Posted - Sep 29 2021 :  09:15:25  Show Profile  Reply
this does not work for me, I have the same error already reported, here is a print of my code.

  try
    ImageEnView1.PdfViewer.SaveToFile('c:\xerife\certtmp.pdf');
    fs := TFileStream.Create('c:\xerife\certtmp.pdf', fmOpenRead);

    fs.Seek (0, soEnd);
    fs.Position := 0;

    ImageEnView3.PdfViewer.Enabled := true;
    ImageEnView3.PdfViewer.ImportPages(fs, '', ImageEnView1.PdfViewer.PageCount);

    stream := TMemoryStream.Create;
    ImageEnView3.PdfViewer.SaveToStream(stream);
    stream.Position := 0;

    ImageEnView2.IO.LoadFromStreamPDF(stream);
    ImageEnView2.Update;
    ImageEnView2.BringToFront;
  finally
    fs.Free;
  end;
Go to Top of Page

xequte

38222 Posts

Posted - Sep 29 2021 :  21:29:23  Show Profile  Reply
Hi

Does it work if you don't call SaveToFile directly before creating the stream (may be a file locking issue)?


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

tiagosis

Brazil
36 Posts

Posted - Sep 30 2021 :  09:46:54  Show Profile  Reply
i really need to copy specific pages from one imageenview to another, i already tried importpages with with savetofile, savetostream
and also with:
ImageEnView3.PdfViewer.ImportPages(ImageEnView1.PdfViewer.Document, '', ImageEnView1.PdfViewer.PageCount);

I receive in all

"PDF document is not open."

please how can i finally solve this?

tiago
Go to Top of Page

xequte

38222 Posts

Posted - Sep 30 2021 :  17:45:30  Show Profile  Reply
Hi Tiago

Are you sure that PDFViewer is enabled for all of your ImageEnViews? This works fine for me (new project with two TImageEnView components):

  ImageEnView1.PdfViewer.Enabled := True;
  ImageEnView2.PdfViewer.Enabled := True;
  ImageEnView1.IO.LoadFromFilePDF( 'D:\file1.pdf' );
  ImageEnView2.IO.LoadFromFilePDF( 'D:\file2.pdf' );
  ImageEnView1.PdfViewer.ImportPages(ImageEnView2.PdfViewer.Document, '', ImageEnView2.PdfViewer.PageCount);


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

tiagosis

Brazil
36 Posts

Posted - Oct 01 2021 :  08:26:12  Show Profile  Reply
I'll try to be more clear, I believe you don't understand me.

I need to copy a SINGLE SPECIFIC PAGE from one TImageEN to another TImageEN

I DON'T WANT to copy the entire document just a single page, in this case the last page.

tiago
Go to Top of Page

tiagosis

Brazil
36 Posts

Posted - Oct 01 2021 :  09:50:10  Show Profile  Reply
DeletePages does not work either, listIndex occurs when deleting in some indexes, for example: in a page with 45 pages "listIndex error" on page 25....

tiago
Go to Top of Page

xequte

38222 Posts

Posted - Oct 04 2021 :  16:51:09  Show Profile  Reply
Hi Tiago

To copy a single page you need to pass the page index, e.g.

// Import fifth page (zero-based index)
ImageEnView1.PdfViewer.ImportPages(ImageEnView2.PdfViewer.Document, [4], ImageEnView1.PdfViewer.PageCount );

// Import fifth page (text string - 1 based)
ImageEnView1.PdfViewer.ImportPages(ImageEnView2.PdfViewer.Document, '5', ImageEnView1.PdfViewer.PageCount );


If the second PdfViewer has not been used, it needs to be initialized using NewDocument. I will make this automatic for the next update, e.g.

// Assign fifth page of PDF to ImageEnView1
ImageEnView1.PdfViewer.Enabled := True;
ImageEnView2.PdfViewer.Enabled := True;
ImageEnView2.IO.LoadFromFilePDF( 'd:\file.pdf' );
ImageEnView1.PdfViewer.Document.NewDocument();
ImageEnView1.PdfViewer.ImportPages(ImageEnView2.PdfViewer.Document, [4], ImageEnView1.PdfViewer.PageCount );


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

xequte

38222 Posts

Posted - Oct 04 2021 :  16:54:31  Show Profile  Reply
Also, I cannot reproduce the list index error. Are you using 10.2.0? What steps should i take to reproduce?

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