Remove unused parameter from PromsPrinter constructor

Set the offset of the BackGround (Overlay) depending on the source of the background.  If the background source is 32 Bit set the offset to zero.
Add DebugPagination output for blank pages
Add DebugPagination output for MSWord Sections
Add DbeugPagination output for Foldout pages
Only adjust wordwrap if background is not 32Bit output
Added Back32BitPROMS boolean property to determine if the background is 32 Bit output
This commit is contained in:
Rich 2012-07-25 21:46:29 +00:00
parent 66f9ef6f23
commit dbdb1d6f7d
3 changed files with 28 additions and 14 deletions

View File

@ -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

View File

@ -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)

View File

@ -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
{