public string StartContentObj() { contentRefObj = PDFMaker.GetObjCount() + " 0 R"; string objDeclaration = PDFMaker.GetObjCount() + " 0 obj\r\n<<\r\n/Length 53\r\n>>\r\nstream\r\nBT\r\n"; PDFMaker.IncrementObjCount(); return(objDeclaration); }
public Page(int width, int height) { this.width = width; this.height = height; this.obj_ID = PDFMaker.GetObjCount(); this.page_ID = PDFMaker.GetPageCount(); PDFMaker.IncrementObjCount(); }
public static string CreateResourceObject() { string objContent = PDFMaker.GetObjCount() + " 0 obj\r\n<<\r\n/ProcSet[/PDF/Text]\r\n/Font <</F1 " + fonts[0] + " >>\r\n>>\r\nendobj\r\n"; resourceRefObj = PDFMaker.GetObjCount() + " 0 R"; PDFMaker.IncrementObjCount(); return(objContent); }
public static string CreateFontObject() { int fontID = PDFMaker.GetObjCount(); string objContent = fontID + " 0 obj\r\n<<\r\n/Type /Font\r\n/Subtype /Type1\r\n/Name /F1\r\n/BaseFont /Courier\r\n>>\r\nendobj\r\n"; PDFMaker.IncrementObjCount(); fonts[0] = fontID + " 0 R"; return(objContent); }
private static string CreateCatalogObject() { int obj_ID = PDFMaker.GetObjCount(); catalogRefObj = obj_ID + " 0 R"; PDFMaker.IncrementObjCount(); string obj = obj_ID + " 0 obj\r\n<<\r\n/Type /Catalog\r\n/Pages " + pagesRefObj + "\r\n>>\r\nendobj\r\n"; return(obj); }
public string CreateFooter(string line) { line = line.Replace(@"<PDF_PAGE_NUMBER>", page_ID.ToString()); int indentPixels = 20; //0 = Left edge of the page double fontWidth = 1; //Scale Multiplier. 1 = Normal size double fontHeight = 1; //Scale Multiplier. 1 = Normal size double italics = 0; //Multiplier. 0 = No italics, 1 = EXTREME italics string setup = "/F1 " + footerSize + " Tf\r\n" + fontWidth + " 0 " + italics + " " + fontHeight + " " + indentPixels + " " + (footerSize + 10) + " Tm\r\n"; string lineContent = "(" + line + ")Tj\r\n"; string drawLine = "20 " + (footerSize + 25) + " m 460 35 l h S\r\n"; string pageSetup = "/F1 " + footerSize + " Tf\r\n" + fontWidth + " 0 " + italics + " " + fontHeight + " " + 390 + " " + (footerSize + 10) + " Tm\r\n"; string pageDisplay = "(Page " + page_ID + " of " + PDFMaker.GetPageCount() + ")Tj\r\n";; return(setup + lineContent + drawLine + pageSetup + pageDisplay); }
public static string CreatePagesObject() { int obj_ID = PDFMaker.GetObjCount(); PDFMaker.pagesRefObj = obj_ID + " 0 R"; PDFMaker.IncrementObjCount(); string obj = obj_ID + " 0 obj\r\n<<\r\n/Type /Pages\r\n/Kids [ "; foreach (Page p in pages) { if (p != null) { obj = obj + p.GetID() + " 0 R "; p.SetParentRefObj(obj_ID + " 0 R"); } } obj = obj + "]\r\n/Count " + PDFMaker.GetPageCount() + "\r\n>>\r\nendobj\r\n"; return(obj); }