C2020-002 Logic to use either the Letter or A4 paper size
This commit is contained in:
parent
2234bde5e1
commit
b41320ed24
@ -303,7 +303,9 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
private void btnPrint_Click(object sender, EventArgs e)
|
private void btnPrint_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
OnPrintRequest(new DisplayLibDocEventArgs("Library Document Usage", LibDocList));
|
string paperSize = "Letter";
|
||||||
|
paperSize = LibDocList[listBoxLibDocs.SelectedIndex].LibraryDocumentUsageList[0].ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
|
||||||
|
OnPrintRequest(new DisplayLibDocEventArgs("Library Document Usage", LibDocList, paperSize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class DisplayLibDocEventArgs
|
public class DisplayLibDocEventArgs
|
||||||
@ -321,6 +323,14 @@ namespace Volian.Controls.Library
|
|||||||
get { return _libDocList; }
|
get { return _libDocList; }
|
||||||
set { _libDocList = value; }
|
set { _libDocList = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _PaperSize; // C2020-002 paper size is now set in the format files
|
||||||
|
|
||||||
|
public string PaperSize
|
||||||
|
{
|
||||||
|
get { return _PaperSize; }
|
||||||
|
set { _PaperSize = value; }
|
||||||
|
}
|
||||||
//private string _SearchString = null;
|
//private string _SearchString = null;
|
||||||
//public string SearchString
|
//public string SearchString
|
||||||
//{
|
//{
|
||||||
@ -339,10 +349,11 @@ namespace Volian.Controls.Library
|
|||||||
// get { return _MyItemInfoList; }
|
// get { return _MyItemInfoList; }
|
||||||
// set { _MyItemInfoList = value; }
|
// set { _MyItemInfoList = value; }
|
||||||
//}
|
//}
|
||||||
public DisplayLibDocEventArgs(string reportTitle, DocumentInfoList libDocList)
|
public DisplayLibDocEventArgs(string reportTitle, DocumentInfoList libDocList, string paperSize)
|
||||||
{
|
{
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
_libDocList = libDocList;
|
_libDocList = libDocList;
|
||||||
|
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public delegate void DisplayLibDocEvent(object sender, DisplayLibDocEventArgs args);
|
public delegate void DisplayLibDocEvent(object sender, DisplayLibDocEventArgs args);
|
||||||
|
@ -954,6 +954,9 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private void btnPrintReport_Click(object sender, EventArgs e)
|
private void btnPrintReport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
string paperSize = "Letter";
|
||||||
|
if (Mydocversion != null && Mydocversion.ActiveFormat != null)
|
||||||
|
paperSize = Mydocversion.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
|
||||||
//B2019-144 Set the document text color to Red (overlay) or Black (normal)
|
//B2019-144 Set the document text color to Red (overlay) or Black (normal)
|
||||||
Color lastColor = MSWordToPDF.OverrideColor;// B2019-144 Remember override color
|
Color lastColor = MSWordToPDF.OverrideColor;// B2019-144 Remember override color
|
||||||
if (MSWordToPDF.OverrideColor != Color.Black)
|
if (MSWordToPDF.OverrideColor != Color.Black)
|
||||||
@ -966,7 +969,7 @@ namespace Volian.Controls.Library
|
|||||||
GenerateAccIDSortedROList();
|
GenerateAccIDSortedROList();
|
||||||
else
|
else
|
||||||
GenerateROList();
|
GenerateROList();
|
||||||
OnPrintRequest(new DisplayReportsEventArgs("RO Summary Report", "RO Summary Report", MyROFSTLookup, ROList));
|
OnPrintRequest(new DisplayReportsEventArgs("RO Summary Report", "RO Summary Report", MyROFSTLookup, ROList, paperSize));
|
||||||
}
|
}
|
||||||
else if (cbxComplete.Checked) // Complete RO Report
|
else if (cbxComplete.Checked) // Complete RO Report
|
||||||
{
|
{
|
||||||
@ -976,7 +979,8 @@ namespace Volian.Controls.Library
|
|||||||
GenerateROList();
|
GenerateROList();
|
||||||
string ROList = GetListOfROs(false);//don't include the RODbID in the RO list
|
string ROList = GetListOfROs(false);//don't include the RODbID in the RO list
|
||||||
string roDataFile = BuildRODataFile(ROList);
|
string roDataFile = BuildRODataFile(ROList);
|
||||||
OnPrintRequest(new DisplayReportsEventArgs("Complete RO Report", "Complete RO Report", roDataFile, MyROFSTLookup, cbxComplete.Checked, this.Mydocversion.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, cbxIncldMissingROs.Checked));
|
if (Mydocversion != null)
|
||||||
|
OnPrintRequest(new DisplayReportsEventArgs("Complete RO Report", "Complete RO Report", roDataFile, MyROFSTLookup, cbxComplete.Checked, Mydocversion.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, cbxIncldMissingROs.Checked, paperSize));
|
||||||
}
|
}
|
||||||
else if (cbxROUsage.Checked)
|
else if (cbxROUsage.Checked)
|
||||||
{
|
{
|
||||||
@ -988,10 +992,10 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
Csla.SortedBindingList<ItemInfo> sortedResults = new Csla.SortedBindingList<ItemInfo>(SearchResults);
|
Csla.SortedBindingList<ItemInfo> sortedResults = new Csla.SortedBindingList<ItemInfo>(SearchResults);
|
||||||
sortedResults.ApplySort("FoundROID", ListSortDirection.Ascending);
|
sortedResults.ApplySort("FoundROID", ListSortDirection.Ascending);
|
||||||
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By RO", "RO Usage", sortedResults, usageSortedByProcedure, cbxIncldMissingROs.Checked));
|
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By RO", "RO Usage", sortedResults, usageSortedByProcedure, cbxIncldMissingROs.Checked, paperSize));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By Procedure", "RO Usage", SearchResults, usageSortedByProcedure, cbxIncldMissingROs.Checked));
|
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By Procedure", "RO Usage", SearchResults, usageSortedByProcedure, cbxIncldMissingROs.Checked, paperSize));
|
||||||
}
|
}
|
||||||
else if (cbxTransFromProcs.Checked)
|
else if (cbxTransFromProcs.Checked)
|
||||||
{
|
{
|
||||||
@ -1079,7 +1083,13 @@ namespace Volian.Controls.Library
|
|||||||
get { return _IncludeEmptyROFields; }
|
get { return _IncludeEmptyROFields; }
|
||||||
set { _IncludeEmptyROFields = value; }
|
set { _IncludeEmptyROFields = value; }
|
||||||
}
|
}
|
||||||
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ICollection<ItemInfo> myItemInfoList, bool sortByProcedure, bool includeMissingROs)
|
private string _PaperSize = "Letter";
|
||||||
|
public string PaperSize // C2020-002 paper size is now set in the format files
|
||||||
|
{
|
||||||
|
get { return _PaperSize; }
|
||||||
|
set { _PaperSize = value; }
|
||||||
|
}
|
||||||
|
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ICollection<ItemInfo> myItemInfoList, bool sortByProcedure, bool includeMissingROs, string paperSize)
|
||||||
{
|
{
|
||||||
// RO Usage Report
|
// RO Usage Report
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
@ -1087,9 +1097,10 @@ namespace Volian.Controls.Library
|
|||||||
_MyItemInfoList = myItemInfoList;
|
_MyItemInfoList = myItemInfoList;
|
||||||
_SortUsageByProcedure = sortByProcedure;
|
_SortUsageByProcedure = sortByProcedure;
|
||||||
_IncludeMissingROs = includeMissingROs;
|
_IncludeMissingROs = includeMissingROs;
|
||||||
|
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
|
||||||
|
|
||||||
}
|
}
|
||||||
public DisplayReportsEventArgs(string reportTitle, string typesSelected, string roDataFile, ROFSTLookup rofstLookUp, bool completeROReport, bool convertCaretToDelta, bool includeEmptyROFields)
|
public DisplayReportsEventArgs(string reportTitle, string typesSelected, string roDataFile, ROFSTLookup rofstLookUp, bool completeROReport, bool convertCaretToDelta, bool includeEmptyROFields, string paperSize)
|
||||||
{
|
{
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
_TypesSelected = typesSelected;
|
_TypesSelected = typesSelected;
|
||||||
@ -1098,14 +1109,16 @@ namespace Volian.Controls.Library
|
|||||||
_ConvertCaretToDelta = convertCaretToDelta;
|
_ConvertCaretToDelta = convertCaretToDelta;
|
||||||
_rofstLookup = rofstLookUp;
|
_rofstLookup = rofstLookUp;
|
||||||
_IncludeEmptyROFields = includeEmptyROFields;
|
_IncludeEmptyROFields = includeEmptyROFields;
|
||||||
|
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ROFSTLookup rofstLookUp, List<string> roListForReport)
|
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ROFSTLookup rofstLookUp, List<string> roListForReport, string paperSize)
|
||||||
{
|
{
|
||||||
// RO Summary Report
|
// RO Summary Report
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
_TypesSelected = typesSelected;
|
_TypesSelected = typesSelected;
|
||||||
_rofstLookup = rofstLookUp;
|
_rofstLookup = rofstLookUp;
|
||||||
_ROListForReport = roListForReport;
|
_ROListForReport = roListForReport;
|
||||||
|
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public delegate void DisplayReportsEvent(object sender, DisplayReportsEventArgs args);
|
public delegate void DisplayReportsEvent(object sender, DisplayReportsEventArgs args);
|
||||||
|
@ -2413,6 +2413,13 @@ namespace Volian.Controls.Library
|
|||||||
get { return _HowLong; }
|
get { return _HowLong; }
|
||||||
set { _HowLong = value; }
|
set { _HowLong = value; }
|
||||||
}
|
}
|
||||||
|
private string _PaperSize;
|
||||||
|
|
||||||
|
public string PaperSize // C2020-002 paper size is now set in the format files
|
||||||
|
{
|
||||||
|
get { return _PaperSize; }
|
||||||
|
set { _PaperSize = value; }
|
||||||
|
}
|
||||||
public DisplaySearchEventArgs(TimeSpan howLong)
|
public DisplaySearchEventArgs(TimeSpan howLong)
|
||||||
{
|
{
|
||||||
HowLong = howLong;
|
HowLong = howLong;
|
||||||
@ -2423,6 +2430,12 @@ namespace Volian.Controls.Library
|
|||||||
_TypesSelected = typesSelected;
|
_TypesSelected = typesSelected;
|
||||||
_MyItemInfoList = myItemInfoList;
|
_MyItemInfoList = myItemInfoList;
|
||||||
_SearchString = searchString;
|
_SearchString = searchString;
|
||||||
|
foreach (ItemInfo tmpII in myItemInfoList)
|
||||||
|
if (tmpII != null && tmpII.ActiveFormat != null)
|
||||||
|
{
|
||||||
|
_PaperSize = tmpII.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public delegate void DisplaySearchEvent(object sender, DisplaySearchEventArgs args);
|
public delegate void DisplaySearchEvent(object sender, DisplaySearchEventArgs args);
|
||||||
|
@ -742,7 +742,6 @@ namespace Volian.Print.Library
|
|||||||
AddText(Hdrs.strHdrs[iLoop].Replace("__"," "), F12Bold); // should be bold and first header is centered
|
AddText(Hdrs.strHdrs[iLoop].Replace("__"," "), F12Bold); // should be bold and first header is centered
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static float _Top = 792;
|
|
||||||
public PdfDestination MyPdfDestTop
|
public PdfDestination MyPdfDestTop
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -124,11 +124,12 @@ namespace Volian.Print.Library
|
|||||||
int numPages = reader.NumberOfPages;
|
int numPages = reader.NumberOfPages;
|
||||||
int currentPageNumber = 0;
|
int currentPageNumber = 0;
|
||||||
PdfOutline outline = null;
|
PdfOutline outline = null;
|
||||||
|
Rectangle paperSize = PDFPageSize.UsePaperSize(_docVersionInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
do // merging pages into complete...
|
do // merging pages into complete...
|
||||||
{
|
{
|
||||||
currentPageNumber += 1;
|
currentPageNumber += 1;
|
||||||
mergedPageNumber += 1;
|
mergedPageNumber += 1;
|
||||||
doc.SetPageSize(PageSize.LETTER);
|
doc.SetPageSize(paperSize);
|
||||||
doc.NewPage();
|
doc.NewPage();
|
||||||
PdfImportedPage page = writer.GetImportedPage(reader, currentPageNumber); // gets a page that is 'ready' to be written to combined pdf
|
PdfImportedPage page = writer.GetImportedPage(reader, currentPageNumber); // gets a page that is 'ready' to be written to combined pdf
|
||||||
if (doPageNum) // get the string & fill in with <page> and <of> numbers
|
if (doPageNum) // get the string & fill in with <page> and <of> numbers
|
||||||
|
@ -59,7 +59,8 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
public void BuildChronology()
|
public void BuildChronology()
|
||||||
{
|
{
|
||||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
Rectangle paperSize = PDFPageSize.UsePaperSize(MyProc.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize);// C2020-002 paper size is now set in the format files
|
||||||
|
iTextSharp.text.Document document = new iTextSharp.text.Document(paperSize, 36, 36, 36, 36);
|
||||||
if (!CreateResultsPDF(document)) return;
|
if (!CreateResultsPDF(document)) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -92,7 +93,8 @@ namespace Volian.Print.Library
|
|||||||
public void BuildSummary(bool openReport)
|
public void BuildSummary(bool openReport)
|
||||||
{
|
{
|
||||||
bool hasData = false;
|
bool hasData = false;
|
||||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
Rectangle paperSize = PDFPageSize.UsePaperSize(MyProc.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
|
iTextSharp.text.Document document = new iTextSharp.text.Document(paperSize, 36, 36, 36, 36);
|
||||||
if (!CreateResultsPDF(document)) return;
|
if (!CreateResultsPDF(document)) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,8 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
public void BuildReport()
|
public void BuildReport()
|
||||||
{
|
{
|
||||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
Rectangle paperSize = PDFPageSize.UsePaperSize(MyDocVersion.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
|
iTextSharp.text.Document document = new iTextSharp.text.Document(paperSize, 36, 36, 36, 36);
|
||||||
if (!CreateResultsPDF(document)) return;
|
if (!CreateResultsPDF(document)) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -225,7 +226,8 @@ namespace Volian.Print.Library
|
|||||||
public void BuildAllReport(DocVersionInfo dvi)
|
public void BuildAllReport(DocVersionInfo dvi)
|
||||||
{
|
{
|
||||||
MyDocVersion = dvi;
|
MyDocVersion = dvi;
|
||||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
Rectangle paperSize = PDFPageSize.UsePaperSize(MyDocVersion.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
|
iTextSharp.text.Document document = new iTextSharp.text.Document(paperSize, 36, 36, 36, 36);
|
||||||
if (!CreateResultsPDF(document)) return;
|
if (!CreateResultsPDF(document)) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -75,8 +75,9 @@ namespace Volian.Print.Library
|
|||||||
private bool _ConvertCaretToDelta = true;
|
private bool _ConvertCaretToDelta = true;
|
||||||
private bool _IncludeEmptyROFields = false;
|
private bool _IncludeEmptyROFields = false;
|
||||||
|
|
||||||
|
private string _PaperSize = "Letter"; // C2020-002 paper size is now set in the format files
|
||||||
// Search Results Report
|
// Search Results Report
|
||||||
public PDFReport(string reportTitle, string typesSelected, ICollection<ItemInfo> resultList, string fileName)
|
public PDFReport(string reportTitle, string typesSelected, ICollection<ItemInfo> resultList, string fileName, string paperSize)
|
||||||
{
|
{
|
||||||
_ResultList = resultList;
|
_ResultList = resultList;
|
||||||
_FileName = fileName;
|
_FileName = fileName;
|
||||||
@ -84,21 +85,23 @@ namespace Volian.Print.Library
|
|||||||
_TypesSelected = VEPROMS.CSLA.Library.ItemInfo.ConvertToDisplayText(typesSelected);
|
_TypesSelected = VEPROMS.CSLA.Library.ItemInfo.ConvertToDisplayText(typesSelected);
|
||||||
_ReportType = (int)ReportType.SearchResults;
|
_ReportType = (int)ReportType.SearchResults;
|
||||||
_ByLine = "PROMS Search Results";
|
_ByLine = "PROMS Search Results";
|
||||||
|
_PaperSize = paperSize;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Library Document Report
|
// Library Document Report
|
||||||
public PDFReport(string reportTitle, DocumentInfoList libDocList, string fileName)
|
public PDFReport(string reportTitle, DocumentInfoList libDocList, string fileName, string paperSize)
|
||||||
{
|
{
|
||||||
_LibDocList = libDocList;
|
_LibDocList = libDocList;
|
||||||
_FileName = fileName;
|
_FileName = fileName;
|
||||||
_ReportTitle = VEPROMS.CSLA.Library.ItemInfo.ConvertToDisplayText(reportTitle);
|
_ReportTitle = VEPROMS.CSLA.Library.ItemInfo.ConvertToDisplayText(reportTitle);
|
||||||
_ReportType = (int)ReportType.LibraryDocUsage;
|
_ReportType = (int)ReportType.LibraryDocUsage;
|
||||||
_ByLine = "Generated By PROMS";
|
_ByLine = "Generated By PROMS";
|
||||||
|
_PaperSize = paperSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RO Usage
|
// RO Usage
|
||||||
public PDFReport(string reportTitle, ICollection<ItemInfo> resultList, string fileName, bool sortUsageByProcedure, bool includeMissingROs)
|
public PDFReport(string reportTitle, ICollection<ItemInfo> resultList, string fileName, bool sortUsageByProcedure, bool includeMissingROs, string paperSize)
|
||||||
{
|
{
|
||||||
_ResultList = resultList;
|
_ResultList = resultList;
|
||||||
_FileName = fileName;
|
_FileName = fileName;
|
||||||
@ -107,10 +110,11 @@ namespace Volian.Print.Library
|
|||||||
_ByLine = "Generated By PROMS";
|
_ByLine = "Generated By PROMS";
|
||||||
_SortUsageByProcedure = sortUsageByProcedure;
|
_SortUsageByProcedure = sortUsageByProcedure;
|
||||||
_IncludeMissingROs = includeMissingROs;
|
_IncludeMissingROs = includeMissingROs;
|
||||||
|
_PaperSize = paperSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RO Complete RO Report
|
// RO Complete RO Report
|
||||||
public PDFReport(string reportTitle, string roDataFile, string outfile, ROFSTLookup fstlookup, bool completeReport, bool convertCaretToDelta, bool includeEmptyROFields)
|
public PDFReport(string reportTitle, string roDataFile, string outfile, ROFSTLookup fstlookup, bool completeReport, bool convertCaretToDelta, bool includeEmptyROFields, string paperSize)
|
||||||
{
|
{
|
||||||
_FileName = outfile;
|
_FileName = outfile;
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
@ -120,10 +124,11 @@ namespace Volian.Print.Library
|
|||||||
_ConvertCaretToDelta = convertCaretToDelta;
|
_ConvertCaretToDelta = convertCaretToDelta;
|
||||||
_ROFSTLookup = fstlookup;
|
_ROFSTLookup = fstlookup;
|
||||||
_IncludeEmptyROFields = includeEmptyROFields;
|
_IncludeEmptyROFields = includeEmptyROFields;
|
||||||
|
_PaperSize = paperSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RO Summary Report
|
// RO Summary Report
|
||||||
public PDFReport(string reportTitle, string outfile, ROFSTLookup fstlookup, List<string> roList)
|
public PDFReport(string reportTitle, string outfile, ROFSTLookup fstlookup, List<string> roList, string paperSize)
|
||||||
{
|
{
|
||||||
_FileName = outfile;
|
_FileName = outfile;
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
@ -131,6 +136,7 @@ namespace Volian.Print.Library
|
|||||||
_ByLine = "RO Summary Report";
|
_ByLine = "RO Summary Report";
|
||||||
_ROFSTLookup = fstlookup;
|
_ROFSTLookup = fstlookup;
|
||||||
_ROList = roList;
|
_ROList = roList;
|
||||||
|
_PaperSize = paperSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string AddGroup(PdfPTable datatable, string dvPath, string lastDvPath, Font f2, bool StripLast, Color bgColor, bool skipFirst)
|
private string AddGroup(PdfPTable datatable, string dvPath, string lastDvPath, Font f2, bool StripLast, Color bgColor, bool skipFirst)
|
||||||
@ -365,7 +371,8 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
public void Build()
|
public void Build()
|
||||||
{
|
{
|
||||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
//iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
||||||
|
iTextSharp.text.Document document = new iTextSharp.text.Document(PDFPageSize.UsePaperSize(_PaperSize), 36, 36, 36, 36); // C2020-002 paper size is now set in the format files
|
||||||
if (!CreateResultsPDF(document, _ReportType)) return;
|
if (!CreateResultsPDF(document, _ReportType)) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -72,10 +72,13 @@ namespace Volian.Print.Library
|
|||||||
get { return _ProcedureCount; }
|
get { return _ProcedureCount; }
|
||||||
set { _ProcedureCount = value; }
|
set { _ProcedureCount = value; }
|
||||||
}
|
}
|
||||||
|
private string _PaperSize = "Letter";
|
||||||
public PDFTransitionReport(FolderInfo fi, string fileName)
|
public PDFTransitionReport(FolderInfo fi, string fileName)
|
||||||
{
|
{
|
||||||
_FileName = fileName;
|
_FileName = fileName;
|
||||||
folderInfo = fi;
|
folderInfo = fi;
|
||||||
|
if (fi.ActiveFormat != null)
|
||||||
|
_PaperSize = fi.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
public PDFTransitionReport(ProcedureInfo pi, string fileName)
|
public PDFTransitionReport(ProcedureInfo pi, string fileName)
|
||||||
{
|
{
|
||||||
@ -83,10 +86,12 @@ namespace Volian.Print.Library
|
|||||||
procedureInfo = pi;
|
procedureInfo = pi;
|
||||||
transitionInfoList = TransitionInfoList.GetTransitionReportData(procedureInfo.MyDocVersion.VersionID, procedureInfo.ItemID);
|
transitionInfoList = TransitionInfoList.GetTransitionReportData(procedureInfo.MyDocVersion.VersionID, procedureInfo.ItemID);
|
||||||
_TransitionInfoCount = transitionInfoList.Count;
|
_TransitionInfoCount = transitionInfoList.Count;
|
||||||
|
_PaperSize = pi.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
public void BuildTransitionReport()
|
public void BuildTransitionReport()
|
||||||
{
|
{
|
||||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER.Rotate(), 36, 36, 36, 36);
|
Rectangle paperSize = PDFPageSize.UsePaperSize(_PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
|
iTextSharp.text.Document document = new iTextSharp.text.Document(paperSize.Rotate(), 36, 36, 36, 36);
|
||||||
if (!CreateResultsPDF(document)) return;
|
if (!CreateResultsPDF(document)) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -768,8 +768,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
private float GetYPageSizeUseOnAllButFirstPage()
|
private float GetYPageSizeUseOnAllButFirstPage()
|
||||||
{
|
{
|
||||||
//float _PointsPerPage = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // A4 paper logic
|
float _PointsPerPage = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
float _PointsPerPage = 792;
|
|
||||||
int indx = (int)MyItemInfo.MyDocStyle.IndexOtherThanFirstPage;
|
int indx = (int)MyItemInfo.MyDocStyle.IndexOtherThanFirstPage;
|
||||||
foreach (DocStyle ds in MyItemInfo.ActiveFormat.PlantFormat.DocStyles.DocStyleList)
|
foreach (DocStyle ds in MyItemInfo.ActiveFormat.PlantFormat.DocStyles.DocStyleList)
|
||||||
{
|
{
|
||||||
|
@ -546,7 +546,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
else // don't use Word margins
|
else // don't use Word margins
|
||||||
{
|
{
|
||||||
rct = PageSize.LETTER;
|
rct = PDFPageSize.UsePaperSize(MyItem.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
// C2018-004 create meta file for baseline compares
|
// C2018-004 create meta file for baseline compares
|
||||||
if (currentSection.IsStepSection)
|
if (currentSection.IsStepSection)
|
||||||
@ -761,7 +761,7 @@ namespace Volian.Print.Library
|
|||||||
// Create an MSWord Pdf
|
// Create an MSWord Pdf
|
||||||
// Setup a pdf Document for printing
|
// Setup a pdf Document for printing
|
||||||
OnStatusChanged("Before OpenDoc", PromsPrinterStatusType.Before);
|
OnStatusChanged("Before OpenDoc", PromsPrinterStatusType.Before);
|
||||||
iTextSharp.text.Rectangle rct = PageSize.LETTER;
|
iTextSharp.text.Rectangle rct = PDFPageSize.UsePaperSize(myProcedure.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
if (myProcedure.Sections != null && !myProcedure.Sections[0].IsStepSection && !doingFoldout) // B2019-166 also don't do this if doing a foldout else it will use the margins set in word
|
if (myProcedure.Sections != null && !myProcedure.Sections[0].IsStepSection && !doingFoldout) // B2019-166 also don't do this if doing a foldout else it will use the margins set in word
|
||||||
{
|
{
|
||||||
SectionInfo si = myProcedure.Sections[0] as SectionInfo;
|
SectionInfo si = myProcedure.Sections[0] as SectionInfo;
|
||||||
@ -1271,7 +1271,7 @@ namespace Volian.Print.Library
|
|||||||
private void GenerateTOC(SectionInfo tocSection, ProcedureInfo myProcedure, PdfContentByte cb, PdfLayer textLayer)
|
private void GenerateTOC(SectionInfo tocSection, ProcedureInfo myProcedure, PdfContentByte cb, PdfLayer textLayer)
|
||||||
{
|
{
|
||||||
iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter;
|
iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter;
|
||||||
float _PointsPerPage = 792;
|
float _PointsPerPage = PDFPageSize.PaperSizePoints(myProcedure.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
float yTopMargin = _PointsPerPage - (float)tocSection.MyDocStyle.Layout.TopMargin;
|
float yTopMargin = _PointsPerPage - (float)tocSection.MyDocStyle.Layout.TopMargin;
|
||||||
float yBottomMargin = Math.Max(0, yTopMargin - (float)tocSection.MyDocStyle.Layout.PageLength); // - 2 * vlnPrintObject.SixLinesPerInch);
|
float yBottomMargin = Math.Max(0, yTopMargin - (float)tocSection.MyDocStyle.Layout.PageLength); // - 2 * vlnPrintObject.SixLinesPerInch);
|
||||||
if (textLayer != null) cb.BeginLayer(textLayer);
|
if (textLayer != null) cb.BeginLayer(textLayer);
|
||||||
@ -1782,8 +1782,8 @@ namespace Volian.Print.Library
|
|||||||
section.StepSectPageBreaksForSupInfo.Clear();
|
section.StepSectPageBreaksForSupInfo.Clear();
|
||||||
section.StepSectPageBreaks.Clear();
|
section.StepSectPageBreaks.Clear();
|
||||||
}
|
}
|
||||||
// 792: 72 * 11 inches - TopRow - Top is high value
|
// 792: 72 * 11 inches - TopRow - Top is high value for 8.5x11 paper, 842 for A4 paper
|
||||||
float _PointsPerPage = 792;
|
float _PointsPerPage = PDFPageSize.PaperSizePoints(myItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
float yTopMargin = _PointsPerPage - (float)myItemInfo.MyDocStyle.Layout.TopMargin;
|
float yTopMargin = _PointsPerPage - (float)myItemInfo.MyDocStyle.Layout.TopMargin;
|
||||||
yTopMargin -= _MyHelper.AdjustTopMarginForMultiLinePageListItems;
|
yTopMargin -= _MyHelper.AdjustTopMarginForMultiLinePageListItems;
|
||||||
// the following line was modified to comment out the - 2 * SixLinesPerInch. this fixed a pagination problem with WCN EMG E-3.
|
// the following line was modified to comment out the - 2 * SixLinesPerInch. this fixed a pagination problem with WCN EMG E-3.
|
||||||
@ -1909,7 +1909,8 @@ namespace Volian.Print.Library
|
|||||||
if (SupInfoPdfPage == null) SupInfoPdfPage = new Dictionary<int, int>();
|
if (SupInfoPdfPage == null) SupInfoPdfPage = new Dictionary<int, int>();
|
||||||
else SupInfoPdfPage.Clear();
|
else SupInfoPdfPage.Clear();
|
||||||
string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + vlnParagraph.MyItemInfo.ItemID.ToString() + @".pdf";
|
string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + vlnParagraph.MyItemInfo.ItemID.ToString() + @".pdf";
|
||||||
PdfContentByte cb = OpenDoc(SupInfoPdfName, PageSize.LETTER);
|
iTextSharp.text.Rectangle pageSize = PDFPageSize.UsePaperSize(MyItem.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
|
PdfContentByte cb = OpenDoc(SupInfoPdfName, pageSize);
|
||||||
if (cb == null) return;
|
if (cb == null) return;
|
||||||
VlnSvgPageHelper myPageHelper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0);
|
VlnSvgPageHelper myPageHelper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0);
|
||||||
cb.PdfWriter.PageEvent = myPageHelper;
|
cb.PdfWriter.PageEvent = myPageHelper;
|
||||||
@ -2410,7 +2411,7 @@ namespace Volian.Print.Library
|
|||||||
string key = string.Format("{0}.{1}", sectInfo.ItemID, pageNumber);
|
string key = string.Format("{0}.{1}", sectInfo.ItemID, pageNumber);
|
||||||
if(dicSize.ContainsKey(key))
|
if(dicSize.ContainsKey(key))
|
||||||
return dicSize[key];
|
return dicSize[key];
|
||||||
return PageSize.LETTER;
|
return PDFPageSize.UsePaperSize(sectInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
public void LoadTree(ItemInfo ii)
|
public void LoadTree(ItemInfo ii)
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,8 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
public void Process()
|
public void Process()
|
||||||
{
|
{
|
||||||
iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER);
|
iTextSharp.text.Document document = new iTextSharp.text.Document(PaperSizeRec); // C2020-002 paper size is now set in the format files
|
||||||
|
int paperSizePoints = PDFPageSize.PaperSizePoints(PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(FileName, FileMode.Create));
|
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(FileName, FileMode.Create));
|
||||||
document.Open();
|
document.Open();
|
||||||
// Open RTF Document
|
// Open RTF Document
|
||||||
@ -65,9 +66,9 @@ namespace Volian.Print.Library
|
|||||||
Paragraph para = rtf2IText.Convert();
|
Paragraph para = rtf2IText.Convert();
|
||||||
para.SetLeading(12F, 0);
|
para.SetLeading(12F, 0);
|
||||||
PdfContentByte cb = writer.DirectContent;
|
PdfContentByte cb = writer.DirectContent;
|
||||||
SampleParagraphs(para, cb, 792-36, 252, 36);
|
SampleParagraphs(para, cb, paperSizePoints - 36, 252, 36); // C2020-002 paper size is now set in the format files
|
||||||
para.Add(new Chunk(" (continued)",para.Font));
|
para.Add(new Chunk(" (continued)", para.Font));
|
||||||
SampleParagraphs(para, cb, 792 - 36, 252, 324);
|
SampleParagraphs(para, cb, paperSizePoints - 36, 252, 324); // C2020-002 paper size is now set in the format files
|
||||||
// Close the document
|
// Close the document
|
||||||
document.Close();
|
document.Close();
|
||||||
}
|
}
|
||||||
@ -80,6 +81,17 @@ namespace Volian.Print.Library
|
|||||||
yTop = newYTop;
|
yTop = newYTop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static string _PaperSize = "LETTER"; // default paper size
|
||||||
|
public static string PaperSize // C2020-002 paper size is now set in the format files
|
||||||
|
{
|
||||||
|
get { return Rtf2Pdf._PaperSize; }
|
||||||
|
set { Rtf2Pdf._PaperSize = value; }
|
||||||
|
}
|
||||||
|
private Rectangle _PaperSizeRec = PageSize.LETTER; // default paper size
|
||||||
|
public Rectangle PaperSizeRec
|
||||||
|
{
|
||||||
|
get { return PDFPageSize.UsePaperSize(PaperSize); }
|
||||||
|
}
|
||||||
private static bool _PdfDebug = true;
|
private static bool _PdfDebug = true;
|
||||||
public static bool PdfDebug
|
public static bool PdfDebug
|
||||||
{
|
{
|
||||||
@ -310,11 +322,12 @@ namespace Volian.Print.Library
|
|||||||
float top = y + Offset.Y;
|
float top = y + Offset.Y;
|
||||||
float right = left + width;
|
float right = left + width;
|
||||||
float bottom = top - height;
|
float bottom = top - height;
|
||||||
|
int paperSizePoints = PDFPageSize.PaperSizePoints(myGrid.MyFlexGrid.MyDVI.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
ColumnText myColumnText = new ColumnText(cb);
|
ColumnText myColumnText = new ColumnText(cb);
|
||||||
myColumnText.SetSimpleColumn(left, top, left + width, yBottomMargin);
|
myColumnText.SetSimpleColumn(left, top, left + width, yBottomMargin);
|
||||||
//if (textLayer != null) cb.BeginLayer(textLayer); // RHM20150507 Table Scrunch
|
//if (textLayer != null) cb.BeginLayer(textLayer); // RHM20150507 Table Scrunch
|
||||||
// C2018-004 create meta file for baseline compares
|
// C2018-004 create meta file for baseline compares
|
||||||
if (top + GridTopAdjust > 792) // B2019-110 Table continued on the next page - off the top of page
|
if (top + GridTopAdjust > paperSizePoints) // B2019-110 Table continued on the next page - off the top of page
|
||||||
{
|
{
|
||||||
_MyLog.ErrorFormat("\r\n===> Table Printing Off the Top of Page");
|
_MyLog.ErrorFormat("\r\n===> Table Printing Off the Top of Page");
|
||||||
Volian.Base.Library.BaselineMetaFile.WriteLine("## Error - Grid Off the Top of Page");
|
Volian.Base.Library.BaselineMetaFile.WriteLine("## Error - Grid Off the Top of Page");
|
||||||
|
@ -357,7 +357,7 @@ namespace Volian.Print.Library
|
|||||||
if (myPageHelper.BottomContent != null)
|
if (myPageHelper.BottomContent != null)
|
||||||
{
|
{
|
||||||
cb.MoveTo(0, (float)myPageHelper.BottomContent);
|
cb.MoveTo(0, (float)myPageHelper.BottomContent);
|
||||||
cb.LineTo(792, (float)myPageHelper.BottomContent);
|
cb.LineTo(PDFPageSize.PaperSizePoints(MySection.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize), (float)myPageHelper.BottomContent); // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (float y = yBottom; y <= yTop; y += 12)
|
for (float y = yBottom; y <= yTop; y += 12)
|
||||||
@ -715,7 +715,7 @@ i = 0;
|
|||||||
float tmp = 0;
|
float tmp = 0;
|
||||||
if (NotesToFootNotes != null && NotesToFootNotes.Count > 0)
|
if (NotesToFootNotes != null && NotesToFootNotes.Count > 0)
|
||||||
{
|
{
|
||||||
float _PointsPerPage = 792;
|
float _PointsPerPage = (float)PDFPageSize.PaperSizePoints(MySection.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
float yTopMargin = _PointsPerPage - (float)MySection.MyDocStyle.Layout.TopMargin;
|
float yTopMargin = _PointsPerPage - (float)MySection.MyDocStyle.Layout.TopMargin;
|
||||||
float myYOff = NotesToFootNotesYoffset;
|
float myYOff = NotesToFootNotesYoffset;
|
||||||
foreach (vlnParagraph ntfn in NotesToFootNotes)
|
foreach (vlnParagraph ntfn in NotesToFootNotes)
|
||||||
@ -1397,7 +1397,7 @@ i = 0;
|
|||||||
//token = Regex.Replace(token, @"[\xB3-\xDF]", " ");
|
//token = Regex.Replace(token, @"[\xB3-\xDF]", " ");
|
||||||
|
|
||||||
// handle any conditional PS tokens
|
// handle any conditional PS tokens
|
||||||
if (plstr.Contains(@"PS="))
|
if (token.Contains(@"PS="))
|
||||||
{
|
{
|
||||||
ProcedureConfig procConfig = new ProcedureConfig(section.MyProcedure.MyContent.Config);
|
ProcedureConfig procConfig = new ProcedureConfig(section.MyProcedure.MyContent.Config);
|
||||||
if (procConfig != null)
|
if (procConfig != null)
|
||||||
|
@ -1381,8 +1381,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
private void ResetDocStyleAndValues(ref float yTopMargin, ref float yBottomMargin)
|
private void ResetDocStyleAndValues(ref float yTopMargin, ref float yBottomMargin)
|
||||||
{
|
{
|
||||||
//float _PointsPerPage = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // A4 paper logic
|
float _PointsPerPage = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize); // C2020-002 paper size is now set in the format files
|
||||||
float _PointsPerPage = 792;
|
|
||||||
// if this document style has another style that is for pages other than first, we need to
|
// if this document style has another style that is for pages other than first, we need to
|
||||||
// reset the document style off of this section AND reset docstyle values used.
|
// reset the document style off of this section AND reset docstyle values used.
|
||||||
// C2018-003 fixed use of getting the active section
|
// C2018-003 fixed use of getting the active section
|
||||||
@ -1706,8 +1705,7 @@ namespace Volian.Print.Library
|
|||||||
if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination())
|
if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination())
|
||||||
{
|
{
|
||||||
RefreshDocStyle();
|
RefreshDocStyle();
|
||||||
//yTopMargin = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize) - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin; // C2018-003 fixed use of getting the active section // A4 paper logic
|
yTopMargin = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize) - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin; // C2018-003 fixed use of getting the active section // C2020-002 paper size is now set in the format files
|
||||||
yTopMargin = 792 - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin; // C2018-003 fixed use of getting the active section
|
|
||||||
yBottomMargin = Math.Max(0, yTopMargin - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.PageLength); // C2018-003 fixed use of getting the active section
|
yBottomMargin = Math.Max(0, yTopMargin - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.PageLength); // C2018-003 fixed use of getting the active section
|
||||||
yPageStart = yTopMargin;
|
yPageStart = yTopMargin;
|
||||||
}
|
}
|
||||||
@ -2803,8 +2801,7 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
if (MyItemInfo.ActiveSection != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PrintSectOnFirst) == E_DocStructStyle.DSS_PrintSectOnFirst) // C2018-003 fixed use of getting the active section
|
if (MyItemInfo.ActiveSection != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PrintSectOnFirst) == E_DocStructStyle.DSS_PrintSectOnFirst) // C2018-003 fixed use of getting the active section
|
||||||
{
|
{
|
||||||
//float localYTopMargin = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize) - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin; // A4 paper logic
|
float localYTopMargin = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize) - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin; // C2020-002 paper size is now set in the format files
|
||||||
float localYTopMargin = 792 - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin;
|
|
||||||
yBtmMarginForMsg = Math.Max(0, localYTopMargin - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.PageLength);
|
yBtmMarginForMsg = Math.Max(0, localYTopMargin - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.PageLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,8 @@ namespace Volian.Print.Library
|
|||||||
public static float GetHeight(PdfContentByte cb, Paragraph iParagraph, string suffix, float width, bool throwException)
|
public static float GetHeight(PdfContentByte cb, Paragraph iParagraph, string suffix, float width, bool throwException)
|
||||||
{
|
{
|
||||||
ColumnText myColumnText = new ColumnText(cb);
|
ColumnText myColumnText = new ColumnText(cb);
|
||||||
myColumnText.SetSimpleColumn(0, 792F, width, 0); // Bottom margin
|
float pgHeight = cb.PdfDocument.PageSize.Height; // C2020-002 paper size is now set in the format files
|
||||||
|
myColumnText.SetSimpleColumn(0, pgHeight, width, 0); // Bottom margin
|
||||||
if (suffix != string.Empty)
|
if (suffix != string.Empty)
|
||||||
{
|
{
|
||||||
Chunk chk = iParagraph.Chunks[0] as Chunk;
|
Chunk chk = iParagraph.Chunks[0] as Chunk;
|
||||||
@ -276,7 +277,7 @@ namespace Volian.Print.Library
|
|||||||
//throw (new Exception("Paragraph longer than a page"));
|
//throw (new Exception("Paragraph longer than a page"));
|
||||||
Console.WriteLine("Paragraph longer than a page");
|
Console.WriteLine("Paragraph longer than a page");
|
||||||
}
|
}
|
||||||
return 792F - myColumnText.YLine; // This gives the height of the Paragraph
|
return pgHeight - myColumnText.YLine; // This gives the height of the Paragraph // C2020-002 paper size is now set in the format files
|
||||||
}
|
}
|
||||||
public float GetTableWidth(PdfContentByte cb, Paragraph iParagraph, float? maxWidth)
|
public float GetTableWidth(PdfContentByte cb, Paragraph iParagraph, float? maxWidth)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user