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
 The generated PDF file is very large

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
Flashcqxg Posted - Sep 23 2021 : 22:04:14
Hi
I tested it with the following code and found that the generated pdf document is very large, about 8M, but the total of 1.jpeg and 2.jpeg is only about 200kb.
I did not use PDF_Compression for compression, because it will slow down the speed of PDF generation. Is there a better way to increase the speed of PDF generation while being able to use relatively small generated documents.

var
  IO: TImageEnIO;
begin
  IO := TImageEnIO.Create(NIL);
  IO.CreatePDFFile('test.pdf');
  try

    IO.LoadFromFile('1.jpeg');
    IO.Params.PDF_PaperSize := iepA3;
    //IO.Params.PDF_Compression := ioPDF_JPEG;
    IO.SaveToPDF;

    IO.LoadFromFile('2.jpeg');
    IO.Params.PDF_PaperSize := iepA3;
    //IO.Params.PDF_Compression := ioPDF_JPEG;
    IO.SaveToPDF;
  finally
    IO.ClosePDFFile;
    IO.Free;
  end;
end;
9   L A T E S T    R E P L I E S    (Newest First)
costasd Posted - Oct 04 2021 : 03:24:40
Perhaps you should try to use multiple threads? This will definitely make it work faster.
Flashcqxg Posted - Sep 26 2021 : 19:30:08
Thanks.
xequte Posted - Sep 26 2021 : 17:27:44
Sorry, I don't see any way to optimize that.

Nigel
Xequte Software
www.imageen.com
Flashcqxg Posted - Sep 26 2021 : 03:34:40
My test: 36 pictures, each picture size does not exceed 150kb, compressed using ioPDF_JPEG, respectively generated 6 different pdf documents, a total of 8 seconds.
I currently have about 300,000 pictures and need to generate about 50,000 pdf documents. Do you have any good suggestions?
xequte Posted - Sep 26 2021 : 01:50:29
I just timed this. It took 1/10th of a second to create the PDF with ioPDF_JPEG, and 1/20th a second with ioPDF_UNCOMPRESSED. That speed seems reasonable.

Nigel
Xequte Software
www.imageen.com
Flashcqxg Posted - Sep 25 2021 : 04:04:13
The total of 1.jpeg and 2.jpeg is only about 200kb.
xequte Posted - Sep 25 2021 : 00:50:06
Hi

Compressing images is slower than direct saving. Are your images very large? Perhaps you could resample (resize them smaller) before saving?

Nigel
Xequte Software
www.imageen.com
Flashcqxg Posted - Sep 24 2021 : 02:13:29
Hi,
I used the ioPDF_LZW or ioPDF_JPEG,but they are slowly,how to faster?
xequte Posted - Sep 24 2021 : 01:57:39
Hi

The default compression is ioPDF_G4FAX, which is not compatible with color images, so defaults to ioPDF_UNCOMPRESSED. You should specify ioPDF_LZW or ioPDF_JPEG.

Nigel
Xequte Software
www.imageen.com