This commit is contained in:
parent
ddf97d9d7e
commit
63ea75f998
@ -309,9 +309,9 @@ namespace Volian.Print.Library
|
|||||||
myPdfFile = BuildMSWordPDF(mySection);
|
myPdfFile = BuildMSWordPDF(mySection);
|
||||||
readerWord = myPdfFile != null ? new PdfReader(myPdfFile) : null;
|
readerWord = myPdfFile != null ? new PdfReader(myPdfFile) : null;
|
||||||
OnStatusChanged("Get Section", PromsPrinterStatusType.GetSection);
|
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++)
|
for (int ii = 0; ii < sectPageCount; ii++)
|
||||||
{
|
{
|
||||||
int pageNumber = 1 + ii;
|
int pageNumber = 1 + ii;
|
||||||
@ -343,12 +343,24 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
_MyHelper.MySvg = null;
|
_MyHelper.MySvg = null;
|
||||||
while (cb.PdfWriter.CurrentPageNumber <= _MyHelper.BackgroundPageCount)
|
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);
|
if (_TextLayer != null) cb.BeginLayer(_TextLayer);
|
||||||
float fontSize = 30;
|
float fontSize = 30;
|
||||||
ColumnText ct = new ColumnText(cb);
|
ColumnText ct = new ColumnText(cb);
|
||||||
iTextSharp.text.Font font = FontFactory.GetFont("Arial", fontSize, new iTextSharp.text.Color(PrintOverride.TextColor));
|
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 xCenter = cb.PdfDocument.PageSize.Width / 2;
|
||||||
float yCenter = cb.PdfDocument.PageSize.Height / 2;
|
float yCenter = cb.PdfDocument.PageSize.Height / 2;
|
||||||
float width = chk.GetWidthPoint() * 1.01F;
|
float width = chk.GetWidthPoint() * 1.01F;
|
||||||
@ -359,13 +371,6 @@ namespace Volian.Print.Library
|
|||||||
cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.TextColor));
|
cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.TextColor));
|
||||||
ct.Go();
|
ct.Go();
|
||||||
if (_TextLayer != null) cb.EndLayer();
|
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)
|
private void CreateStepPdf(SectionInfo section, PdfContentByte cb)
|
||||||
{
|
{
|
||||||
@ -380,7 +385,10 @@ namespace Volian.Print.Library
|
|||||||
Rtf2Pdf.Offset = new PointF(24, 2.5F);
|
Rtf2Pdf.Offset = new PointF(24, 2.5F);
|
||||||
_MyHelper.ChangeBarDefinition = MyChangeBarDefinition;
|
_MyHelper.ChangeBarDefinition = MyChangeBarDefinition;
|
||||||
vlnParagraph myParagraph = new vlnParagraph(null, cb, myItemInfo, (float)myItemInfo.MyDocStyle.Layout.LeftMargin, 0, 0, myItemInfo.ColumnMode, myItemInfo.ActiveFormat);
|
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);
|
myParagraph.ToPdf(cb, yTopMargin, yTopMargin, yBottomMargin);
|
||||||
|
else
|
||||||
|
PrintTextMessage(cb, "No Section Content");
|
||||||
cb.PdfDocument.NewPage();
|
cb.PdfDocument.NewPage();
|
||||||
OnStatusChanged("StepSection converted to PDF " + section.ShortPath, PromsPrinterStatusType.BuildStep);
|
OnStatusChanged("StepSection converted to PDF " + section.ShortPath, PromsPrinterStatusType.BuildStep);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user