Fixed logic when ParaBreak is null

Fixed logic when PDF is open
This commit is contained in:
Rich 2015-03-09 13:13:45 +00:00
parent 66044a2a71
commit c65d3e8cdf
2 changed files with 2 additions and 2 deletions

View File

@ -949,7 +949,7 @@ namespace Volian.Print.Library
} }
} }
} }
if (paraBreak.PageBreakReason == null) if (paraBreak != null && paraBreak.PageBreakReason == null)
paraBreak.PageBreakReason = "Rest of Step fits at 6 LPI"; paraBreak.PageBreakReason = "Rest of Step fits at 6 LPI";
ProfileTimer.Pop(profileDepth); ProfileTimer.Pop(profileDepth);
} }

View File

@ -440,12 +440,12 @@ namespace Volian.Print.Library
// Setup a pdf Document for printing // Setup a pdf Document for printing
OnStatusChanged("Before OpenDoc", PromsPrinterStatusType.Before); OnStatusChanged("Before OpenDoc", PromsPrinterStatusType.Before);
PdfContentByte cb = OpenDoc(outputFileName); PdfContentByte cb = OpenDoc(outputFileName);
SetupProperties(cb.PdfDocument, myProcedure);
if (cb == null) if (cb == null)
{ {
ProfileTimer.Pop(profileDepth); ProfileTimer.Pop(profileDepth);
return null; return null;
} }
SetupProperties(cb.PdfDocument, myProcedure);
OnStatusChanged("Before NewPage", PromsPrinterStatusType.Before); OnStatusChanged("Before NewPage", PromsPrinterStatusType.Before);
cb.PdfDocument.NewPage(); // Start of print cb.PdfDocument.NewPage(); // Start of print
//_MyLog.InfoFormat("NewPage 1 {0}", cb.PdfWriter.CurrentPageNumber); //_MyLog.InfoFormat("NewPage 1 {0}", cb.PdfWriter.CurrentPageNumber);