C2020-002 Logic to use either the Letter or A4 paper size

This commit is contained in:
2020-02-14 17:16:28 +00:00
parent 2234bde5e1
commit b41320ed24
15 changed files with 111 additions and 47 deletions

View File

@@ -250,7 +250,8 @@ namespace Volian.Print.Library
public static float GetHeight(PdfContentByte cb, Paragraph iParagraph, string suffix, float width, bool throwException)
{
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)
{
Chunk chk = iParagraph.Chunks[0] as Chunk;
@@ -276,7 +277,7 @@ namespace Volian.Print.Library
//throw (new Exception("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)
{