#2 Re: PDF Engine » position (rotate) the JPG always in Horizontal » 2014-10-25 12:59:42

hi, below code used.

 

  pdfDoc   :TPdfDocument;
  pdfpage  :TPdfpage;
  JpegImage:TJpegImage;
  pdfImage :TPdfImage;

//=======
    pdfDoc                      := TPdfDocument.Create;
    pdfDoc.Info.Author     := 'Sergio';
    pdfDoc.Info.Creator    := 'Brazil';

    pdfDoc.NewDoc;

    for i:=0 to frmPdf.listview1.items.count-1 do
    begin
           JpegImage := TJpegImage.Create;
           JpegImage.LoadFromFile(caminhoJPG);

           pdfpage.PageWidth := Round(JpegImage.Width * 0.24001);  // for image 300dpi
           pdfpage.PageHeight:= Round(JpegImage.Height * 0.24001);
           pdfImage := TPdfImage.Create(pdfDoc, JpegImage,true);
           pdfDoc.AddXObject('image'+ inttostr(contador+1), pdfimage);
           pdfDoc.Canvas.DrawXObject(0,0,pdfpage.PageWidth,pdfpage.PageHeight,'image'+inttostr(contador+1));
           JpegImage.Free;
   end;
   pdfDoc.SaveToFile(caminhoSalva+'\'+ copiaNome + '.pdf');
   pdfDoc.Free;

#3 PDF Engine » position (rotate) the JPG always in Horizontal » 2014-10-22 01:13:33

serginho99
Replies: 4

Hello,

I would like to position (rotate) the JPG always in Horizontal (with choice), I would like to know the code?

prong the 300dpi JPG always, if it is 100 dpi, 300 dpi to increase.

Board footer

Powered by FluxBB