C2019-012: Merge pdfs

This commit is contained in:
2019-03-12 12:56:58 +00:00
parent cfcf9de352
commit 76bd61b435
13 changed files with 2331 additions and 1242 deletions

View File

@@ -259,9 +259,22 @@ namespace Volian.Print.Library
get { return _BlankPageText; }
set { _BlankPageText = value; }
}
// use DidAll & MergeNotIncuded to know that printing all (not single) was done. Used w/ merge code to know when to return, i.e. not include in merged pdf
private bool _DidAll;
public bool DidAll // value passed in from frmPdfStatusForm
{
get { return _DidAll; }
set { _DidAll = value; }
}
private bool _MergeNotIncluded;
public bool MergeNotIncluded
{
get { return _MergeNotIncluded; }
set { _MergeNotIncluded = value; }
}
public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite,
ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, bool removeTrailngHardReturnsAndManualPageBreaks, string blankPageText)
ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, bool removeTrailngHardReturnsAndManualPageBreaks, string blankPageText, bool didAll)
{
Prefix = prefix; // RHM20150506 Multiline ItemID TextBox
_MyItem = myItem;
@@ -280,6 +293,8 @@ namespace Volian.Print.Library
_SaveLinks = saveLinks;
_RemoveTrailingHardReturnsAndManualPageBreaks = removeTrailngHardReturnsAndManualPageBreaks;
_BlankPageText = blankPageText;
_DidAll = didAll;
_MergeNotIncluded = false;
//_MyReaderHelper.LoadTree(myItem);
}
// Pass 1 PDF Name
@@ -299,7 +314,14 @@ namespace Volian.Print.Library
public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary)
{
if (_MyItem is ProcedureInfo)
{ // B2017-186 First do Procedures that don't have page number transitions
{
ProcedureConfig pcfg = (ProcedureConfig)(_MyItem as ProcedureInfo).MyConfig;
if (DidAll && pcfg.Print_NotInMergeAll) // will be merging a pdf, so don't print this procedure if user set that on procedure propertures
{
_MergeNotIncluded = true;
return null;
}
// B2017-186 First do Procedures that don't have page number transitions
if (!(_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier ||
_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier))
{
@@ -446,11 +468,13 @@ namespace Volian.Print.Library
_PROMSVersionLayer.SetPrint("PROMS Version", true);
}
}
public static int ProcPageCount = -1; // Used to count page numbers in each pdf. This will be used if/when pdfs are merged together.
private void CloseDocument(string fileName)
{
int profileDepth = ProfileTimer.Push(">>>> CloseDocument");
try
{
ProcPageCount = MyContentByte.PdfWriter.CurrentPageNumber - 1;
MyContentByte.PdfDocument.Close();
MyContentByte = null;
}