This commit is contained in:
parent
ddf97d9d7e
commit
63ea75f998
@ -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;
|
||||
@ -344,21 +344,7 @@ namespace Volian.Print.Library
|
||||
_MyHelper.MySvg = null;
|
||||
while (cb.PdfWriter.CurrentPageNumber <= _MyHelper.BackgroundPageCount)
|
||||
{
|
||||
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);
|
||||
float xCenter = cb.PdfDocument.PageSize.Width / 2;
|
||||
float yCenter = cb.PdfDocument.PageSize.Height / 2;
|
||||
float width = chk.GetWidthPoint() * 1.01F;
|
||||
float height = fontSize * 1.5F;
|
||||
ct.SetSimpleColumn(xCenter - width/2, yCenter - height/2, xCenter + width/2, yCenter + height/2);
|
||||
Phrase ph = new Phrase(chk);
|
||||
ct.AddElement(ph);
|
||||
cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.TextColor));
|
||||
ct.Go();
|
||||
if (_TextLayer != null) cb.EndLayer();
|
||||
PrintTextMessage(cb, "No PROMS2010 Output");
|
||||
cb.PdfDocument.NewPage();
|
||||
}
|
||||
}
|
||||
@ -367,6 +353,25 @@ namespace Volian.Print.Library
|
||||
// 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(message, font);
|
||||
float xCenter = cb.PdfDocument.PageSize.Width / 2;
|
||||
float yCenter = cb.PdfDocument.PageSize.Height / 2;
|
||||
float width = chk.GetWidthPoint() * 1.01F;
|
||||
float height = fontSize * 1.5F;
|
||||
ct.SetSimpleColumn(xCenter - width / 2, yCenter - height / 2, xCenter + width / 2, yCenter + height / 2);
|
||||
Phrase ph = new Phrase(chk);
|
||||
ct.AddElement(ph);
|
||||
cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.TextColor));
|
||||
ct.Go();
|
||||
if (_TextLayer != null) cb.EndLayer();
|
||||
}
|
||||
private void CreateStepPdf(SectionInfo section, PdfContentByte cb)
|
||||
{
|
||||
iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter;
|
||||
@ -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);
|
||||
myParagraph.ToPdf(cb, yTopMargin, yTopMargin, yBottomMargin);
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user