This commit is contained in:
Kathy Ruffing 2010-09-28 17:06:49 +00:00
parent ddf97d9d7e
commit 63ea75f998

View File

@ -309,9 +309,9 @@ namespace Volian.Print.Library
myPdfFile = BuildMSWordPDF(mySection);
readerWord = myPdfFile != null ? new PdfReader(myPdfFile) : null;
OnStatusChanged("Get Section", PromsPrinterStatusType.GetSection);
if (mySection.SectionConfig.Section_NumPages != "")
if (mySection.MyContent.MyEntry.MyDocument.DocumentConfig.Printing_Length !=0) //.SectionConfig.Section_NumPages != "")
{
int sectPageCount = (int)(Math.Ceiling(decimal.Parse(mySection.SectionConfig.Section_NumPages)));
int sectPageCount = (int)(Math.Ceiling(mySection.MyContent.MyEntry.MyDocument.DocumentConfig.Printing_Length)); //decimal.Parse(mySection.MyContent.MyEntry.MyDocument.DocumentConfig.Printing_Length)));
for (int ii = 0; ii < sectPageCount; ii++)
{
int pageNumber = 1 + ii;
@ -343,12 +343,24 @@ namespace Volian.Print.Library
{
_MyHelper.MySvg = null;
while (cb.PdfWriter.CurrentPageNumber <= _MyHelper.BackgroundPageCount)
{
PrintTextMessage(cb, "No PROMS2010 Output");
cb.PdfDocument.NewPage();
}
}
OnStatusChanged(myProcedure.DisplayNumber + " PDF Creation Completed", PromsPrinterStatusType.Progress, progress);
CloseDocument(cb, outputFileName);
// Return the fileName;
return outputFileName;
}
private void PrintTextMessage(PdfContentByte cb, string message)
{
if (_TextLayer != null) cb.BeginLayer(_TextLayer);
float fontSize = 30;
ColumnText ct = new ColumnText(cb);
iTextSharp.text.Font font = FontFactory.GetFont("Arial", fontSize, new iTextSharp.text.Color(PrintOverride.TextColor));
Chunk chk = new Chunk("No PROMS2010 Output", font);
Chunk chk = new Chunk(message, font);
float xCenter = cb.PdfDocument.PageSize.Width / 2;
float yCenter = cb.PdfDocument.PageSize.Height / 2;
float width = chk.GetWidthPoint() * 1.01F;
@ -359,13 +371,6 @@ namespace Volian.Print.Library
cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.TextColor));
ct.Go();
if (_TextLayer != null) cb.EndLayer();
cb.PdfDocument.NewPage();
}
}
OnStatusChanged(myProcedure.DisplayNumber + " PDF Creation Completed", PromsPrinterStatusType.Progress, progress);
CloseDocument(cb, outputFileName);
// Return the fileName;
return outputFileName;
}
private void CreateStepPdf(SectionInfo section, PdfContentByte cb)
{
@ -380,7 +385,10 @@ namespace Volian.Print.Library
Rtf2Pdf.Offset = new PointF(24, 2.5F);
_MyHelper.ChangeBarDefinition = MyChangeBarDefinition;
vlnParagraph myParagraph = new vlnParagraph(null, cb, myItemInfo, (float)myItemInfo.MyDocStyle.Layout.LeftMargin, 0, 0, myItemInfo.ColumnMode, myItemInfo.ActiveFormat);
if (myItemInfo.HasChildren)
myParagraph.ToPdf(cb, yTopMargin, yTopMargin, yBottomMargin);
else
PrintTextMessage(cb, "No Section Content");
cb.PdfDocument.NewPage();
OnStatusChanged("StepSection converted to PDF " + section.ShortPath, PromsPrinterStatusType.BuildStep);
}