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
 Add a header/footer to TIF pages

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
Fábio Nascimento Posted - Aug 16 2023 : 20:23:41
Hi

I'm loading a multipage tif in a ImageEnView, add'ing a diagonal text and saving all the pages to PDF successfully with this code:

if FileExists(arquivo) then begin

            ImageENView.IO.Params.PDF_PaperSize := IEStrToPaperSize('A4', iepA4);
            ImageENView.IO.Params.PDF_Compression := ioPDF_G4FAX;
            ImageENView.IO.Params.PDF_PageMargin := Round(1 * Inches_Per_CM * 72);

            ImageENView.IO.CreatePDFFile(
              'c:\testes\' +
              ChangeFileExt(System.SysUtils.ExtractFileName(arquivo),'.pdf'));

            ImageENView.Blank;

            ImageENView.IO.Params.TIFF_ImageIndex := 0;
            ImageENView.IO.LoadFromFile(arquivo);

            for t := 0 to ImageENView.IO.Params.TIFF_ImageCount - 1  do begin

              ImageENView.IO.Params.TIFF_ImageIndex := t;

              if t > 0 then ImageENView.IO.LoadFromFile(arquivo);

              with ImageEnView do begin

                LayersAdd('CERTIDÃO DA MATRÍCULA nº ' + pqry_certidoesNUMERO_DOCUMENTO.AsString,
                  80, clBlack, 'Arial', [fsBold] );
                CurrentLayer.Transparency := 48;
                CurrentLayer.Rotate := 45;
                TIETextLayer(CurrentLayer).SizeToText();
                CurrentLayer.PosX := IELayer_Pos_HCenter;
                CurrentLayer.PosY := IELayer_Pos_VCenter;

                LayersMergeAll();

              end;

              ImageENView.IO.SaveToPDF;

            end;

            ImageENView.IO.ClosePDFFile;
            ImageEnView.ClearAll;

          end


But I need to add a header and a footer into the space created with PDF_PageMargin := Round(1 * Inches_Per_CM * 72);.

I tought about using TextOutEx to add a bordered header/footer at the top/bottom of each page of the TIFF file, but it seens like I can't place that on the space that PDF_PageMargin created, since it is created before I manipulate the tif file.

The problem is that I need to create a blank space on the top/bottom for the header/footer, so they don't overlay with existing text that may or may not exists in that area of the tif files.

Is there a way to achieve that?

Thanks!
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 17 2023 : 20:35:25
Hi

You should set the PDF page margin to 0 and then add the image where it is needed. If you look at the code for TIEPDFBuilder.AddPageWithImage() in iepdf.pas you will see how the margin is used to calculate the image position and size.

You can then add text using TIEPDFBuilder.AddText().

You should take a look at this demo:

Demos\InputOutput\PDFBuilder2\PDFBuilder2.dpr

For more info on TIEPDFBuilder:

https://www.imageen.com/help/TIEPDFBuilder.html



Nigel
Xequte Software
www.imageen.com