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
 Using TImageEnIO inside a thread with iepdf32.dll
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

dcoun

Greece
10 Posts

Posted - Oct 08 2021 :  01:34:36  Show Profile  Reply
I tried to create TImageEnIO inside a thread and transform a pdf file's pages in PNG images.
I got a lot of out of resources error messages during "loadfromfilePDF" if it is inside a thread and no error in the main thread using the same code.
is it my fault or a canvas is used?

Also, can I print from inside a thread or the same problem exists?

How can I print a pdf without needing to show it in TimageEN component? Just load the file and print it.
I noticed that TImageEnIO can print a PDF's page but not in the correct size.

xequte

6420 Posts

Posted - Oct 09 2021 :  17:29:02  Show Profile  Reply
Hi

Unfortunately PDFium is not thread-safe.

You can print a PDF file as follows:

var
  ieview: TImageEnView;
begin
  // Print a PDF file non-visually
  ieview := TImageEnView.Create( self );
  ieview.PdfViewer.Enabled := True;
  ieview.IO.LoadFromFilePDF( 'D:\File.pdf' );
  ieview.PdfViewer.Print( False );
  ieview.Free();
end;


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

dcoun

Greece
10 Posts

Posted - Oct 10 2021 :  07:40:29  Show Profile  Reply
Can this
ieview := TImageEnView.Create( self );
be like the following?
ieview := TImageEnView.Create( nil );

and be run from a console app?
Go to Top of Page

xequte

6420 Posts

Posted - Oct 10 2021 :  18:27:00  Show Profile  Reply
Hi

Yes, it can.



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