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!