I want to read HL7 report file and create a pdf document using document writer. I am able to generate the pdf successfully but the problem i am facing is report is of multiple page and I need to give header and footer in the pdf file. Is there any way to generate pdf's give header and footer on each page?
For advanced pdf creation use one of the open source java pdf libraries. http://java-source.net/open-source/pdf-libraries
Create JavaScript channel or transformer and call library functions.
here is example for iText:
var pageSize = new Packages.com.lowagie.text.Rectangle(0,0,600,800);
var document = new Packages.com.lowagie.text.Document(pageSize);
var writer = Packages.com.lowagie.text.pdf.PdfWriter.getInstance(document, new java.io.FileOutputStream('D:/Mirth/filename.pdf'));
writer.setEncryption(Packages.com.lowagie.text.pdf.PdfWriter.STRENGTH128BITS, passwd, passwd,
Packages.com.lowagie.text.pdf.PdfWriter.AllowCopy | Packages.com.lowagie.text.pdf.PdfWriter.AllowPrinting);
document.open();
document.add(new Packages.com.lowagie.text.Paragraph("Text here"));
var cb = writer.getDirectContent();
// Barcodes
document.add(new Packages.com.lowagie.text.Paragraph("Barcode 128"));
var code128 = new Packages.com.lowagie.text.pdf.Barcode128();
code128.setCode("0123456789 hello");
document.add(code128.createImageWithBarcode(cb, null, null));
code128.setCode("0123456789\uffffMy Raw Barcode (0 - 9)");
code128.setCodeType(11);
document.add(code128.createImageWithBarcode(cb, null, null));
document.close();