diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index af1b7183..33be358b 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -149,13 +149,7 @@ namespace Volian.Print.Library get { return _OriginalPageBreak; } set { _OriginalPageBreak = value; } } - private bool _ComparePROMStoPROMSPDF; // compare folder contains PROMS generated PDFs - public bool ComparePROMStoPROMSPDF - { - get { return _ComparePROMStoPROMSPDF; } - set { _ComparePROMStoPROMSPDF = value; } - } - public PromsPrinter(ItemInfo myItem, string rev, string revDate, string watermark, bool debugOutput, bool origPgBrk, bool promsToPromsPDF, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile) + public PromsPrinter(ItemInfo myItem, string rev, string revDate, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile) { _MyItem = myItem; _Rev = rev; @@ -168,7 +162,6 @@ namespace Volian.Print.Library _MyChangeBarDefinition = cbd; _PDFFile = pdfFile; _OriginalPageBreak = origPgBrk; - _ComparePROMStoPROMSPDF = promsToPromsPDF; } public string Print(string pdfFolder) { @@ -370,10 +363,10 @@ namespace Volian.Print.Library // X argument below: accounts for 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's // characters per inch. // 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in: - if (!_ComparePROMStoPROMSPDF) - _MyHelper.BackgroundOffset = new PointF(2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI, -9.5F); + if (_MyHelper.Back32BitPROMS) // compare folder contains PROMS generated PDF + _MyHelper.BackgroundOffset = new PointF(0, 0); else - _MyHelper.BackgroundOffset = new PointF(0, 0); // compare folder contains PROMS generated PDF + _MyHelper.BackgroundOffset = new PointF(2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI, -9.5F); _MyHelper.BackgroundPageOffset = 0; } _MyHelper.WatermarkLayer = _WatermarkLayer; @@ -420,6 +413,8 @@ namespace Volian.Print.Library { PrintTextMessage(cb, "No Proms Output", _TextLayer); cb.PdfDocument.NewPage(); // only have 16bit pages left (for DebugMode) + DebugPagination.WriteLine("{0},'{1}'", + _MyHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, "No PROMS Output"); } } OnStatusChanged(myProcedure.DisplayNumber + " PDF Creation Completed", PromsPrinterStatusType.Progress, progress); @@ -485,7 +480,13 @@ namespace Volian.Print.Library doimport2 = false; } OnStatusChanged("Read MSWord", PromsPrinterStatusType.ReadMSWord); - if (doimport2) AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, 0, 0); + if (doimport2) + { + AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, 0, 0); + DebugPagination.WriteLine("{0},'{1}',{2}", + _MyHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, mySection.ShortPath,pageNumber); + + } if (ii == sectPageCount - 1) { // if there's and end message, add it to the appropriate location on the last page of @@ -748,7 +749,12 @@ namespace Volian.Print.Library Console.WriteLine(ex); doimport2 = false; } - if (doimport2) AddImportedPageToLayer(cb.PdfWriter.DirectContent, textLayer, fgPage, 0, 0); + if (doimport2) + { + AddImportedPageToLayer(cb.PdfWriter.DirectContent, textLayer, fgPage, 0, 0); + DebugPagination.WriteLine("{0},'{1}',{2}", + myPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, "Foldout", 1); + } } //PrintTextMessage(cb, "Foldout for: " + str, textLayer); cb.PdfDocument.NewPage(); // Temporary for foldout/16bit-32bit page alignment diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs b/PROMS/Volian.Print.Library/vlnPrintObject.cs index 612b03cd..2d246705 100644 --- a/PROMS/Volian.Print.Library/vlnPrintObject.cs +++ b/PROMS/Volian.Print.Library/vlnPrintObject.cs @@ -116,7 +116,7 @@ namespace Volian.Print.Library VlnSvgPageHelper ph = null; if(cb != null) ph = cb.PdfWriter.PageEvent as VlnSvgPageHelper; float heightAll = GetHeight(cb, iParagraph, width, throwException); - if (ph != null && ph.MyPromsPrinter.DebugOutput) + if (ph != null && ph.MyPromsPrinter.DebugOutput && !MyPageHelper.Back32BitPROMS) { vlnParagraph myParagraph = this as vlnParagraph; if (myParagraph != null) diff --git a/PROMS/Volian.Svg.Library/iTextSharp.cs b/PROMS/Volian.Svg.Library/iTextSharp.cs index 761843a5..93284233 100644 --- a/PROMS/Volian.Svg.Library/iTextSharp.cs +++ b/PROMS/Volian.Svg.Library/iTextSharp.cs @@ -937,6 +937,14 @@ namespace Volian.Svg.Library return _BackgroundReader; } } + public bool Back32BitPROMS + { + get + { + if (BackgroundReader == null) return false; + return BackgroundReader.Info["Producer"].ToString().StartsWith("iTextSharp"); + } + } private string _BackgroundFile = null; public string BackgroundFile {