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
 Merging different types of images and/or PDFs
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

FLDelphi

19 Posts

Posted - Mar 09 2022 :  14:25:25  Show Profile  Reply
I've tried my best to combine all of the PDF demos to provide my users a mechanism to merge multiple different types of files (could be jpgs, gifs, bmps, and/or PDFs) into a PDF.

When the files are non-PDF only, it's quite good. But when the files are PDFs only or PDF + some images, the quality drops pretty significantly. I've tweaked the compression/paper sizes/margins, but can't find any combination that helps.

Image En 10.2.0 Delphi XE3



  pdfBuilder := TIEPDFBuilder.Create;
  try
    imageIO := TImageEnIO.Create(nil);
    try
      imageIO.Params.PDF_Compression := ioPDF_LZW;
//      imageIO.Params.PDF_PaperSize := paperSize;
//      imageIO.Params.PDF_PageMargin := PDF_Page_Margin;
      for TempDoc in aDocumentList do
      begin
        FileExtension := LowerCase(ExtractFileExt(TempDoc.FileName));

        if FileExtension <> '.pdf' then
        begin
          imageIO.LoadFromFile(TempDoc.FileName);
          pdfBuilder.AddPageWithImage(imageIO.IEBitmap, imageIO.Params);
        end
        else
        begin
          imageIO.LoadFromFilePDF(TempDoc.FileName);
          imageIO.Seek(ieioSeekFirst);
          pdfBuilder.AddPageWithImage(imageIO.IEBitmap, imageIO.Params);

          idx := 0;
          while imageIO.Seek( ieioSeekNext ) <> idx do
          begin
            pdfBuilder.AddPageWithImage(imageIO.IEBitmap, imageIO.Params);
            inc(idx);
          end;
        end;
      end;
    finally
      imageIO.Free;
    end;

    pdfBuilder.SaveToFile(FFilePathAndName);
  finally
    pdfBuilder.Free;
  end;

xequte

38608 Posts

Posted - Mar 09 2022 :  18:06:15  Show Profile  Reply
Hi

Next week, we'll be releasing v10.3.5. In that version you can improve PDF rendering quality using IEGlobalSettings().PdfViewerDefaults.DPI

// When rendering PDF files scale to double size
IEGlobalSettings().PdfViewerDefaults.DPI := 144;    // PDF files are 72 DPI, so 144 is 200% size
ImageEnView1.IO.LoadFromFilePDF( 'C:\Test.pdf' );


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