Hello,
I have a issue with PDF. Is there any way that if the text gets cut off at the bottom of the PDF and it could be moved to the page? it is more likely page break.
Please see below a code. Can you help fixing this as soon as possible?
Below is a code:
Code:
PIASection PIASectionBLL = new PIASection();
PIASection5Info GetPIASection = PIASectionBLL.GetPIASection5(pia_id);
PdfPage page = document.AddPage();
page.Orientation = PageOrientation.Landscape;
Generator.GenHeader(page, "PIA Section 5", pia_year);
Document migDoc = new Document();
Section section = migDoc.AddSection();
section.AddPageBreak();
Table table = section.AddTable();
table.Format.Font.Size = 10;
table.Format.Font.Name = "Times New Roman";
table.Borders.Visible = false;
table.Rows.VerticalAlignment = VerticalAlignment.Center;
column = table.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Left;
column = table.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Left;
column = table.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Left;
column = table.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Left;
column = table.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Left;
table.Rows.Height = 15;
row = table.AddRow();
row.Shading.Color = Color.Parse("blue");
row.Borders.Visible = true;
row.Cells[0].AddParagraph("Program Office or IT System information is shared with");
row.Cells[1].AddParagraph("Reason why information is shared with the specified program or IT system");
row.Cells[2].AddParagraph("List the specific information types that are shared with the Program or IT system");
row.Cells[3].AddParagraph("Legal authority, binding agreement, SORN routine use, etc that permit external sharing (can be more than one)");
row.Cells[4].AddParagraph("Method of transmittal");
for (int c = 0; c < 5; c++)
{
row.Cells[c].Shading.Color = Color.FromRgbColor((byte)255, Color.Parse("0x1E2D54"));
row.Cells[c].Format.Font.Bold = true;
row.Cells[c].Format.Font.Size = 7;
row.Cells[c].Format.Font.Color = Color.Parse("white");
row.Cells[c].Tag = "header";
}
if (GetPIASection.ExternalDataCollection != null)
{
if (GetPIASection.ExternalDataCollection.Count > 0)
{
foreach (ExternalSharingInfo int_row in GetPIASection.ExternalDataCollection)
{
row = table.AddRow();
row.Borders.Visible = true;
row.Cells[0].AddParagraph(int_row.program_office);
row.Cells[0].Shading.Color = Color.Parse(green);
row.Cells[1].AddParagraph(int_row.reason_information);
row.Cells[1].Shading.Color = Color.Parse(green);
row.Cells[2].AddParagraph(int_row.list_information);
row.Cells[2].Shading.Color = Color.Parse(green);
row.Cells[3].AddParagraph(int_row.legal_auth);
row.Cells[3].Shading.Color = Color.Parse(green);
row.Cells[4].AddParagraph(int_row.method_trans);
row.Cells[4].Shading.Color = Color.Parse(green);
}
}
else
{
row = table.AddRow();
row.Borders.Visible = true;
row.Cells[0].AddParagraph("");
row.Cells[0].Shading.Color = Color.Parse(green);
row.Cells[1].AddParagraph("");
row.Cells[1].Shading.Color = Color.Parse(green);
row.Cells[2].AddParagraph("");
row.Cells[2].Shading.Color = Color.Parse(green);
row.Cells[3].AddParagraph("");
row.Cells[3].Shading.Color = Color.Parse(green);
row.Cells[4].AddParagraph("");
row.Cells[4].Shading.Color = Color.Parse(green);
}
}
else
{
row = table.AddRow();
row.Borders.Visible = true;
row.Cells[0].AddParagraph("");
row.Cells[0].Shading.Color = Color.Parse(green);
row.Cells[1].AddParagraph("");
row.Cells[1].Shading.Color = Color.Parse(green);
row.Cells[2].AddParagraph("");
row.Cells[2].Shading.Color = Color.Parse(green);
row.Cells[3].AddParagraph("");
row.Cells[3].Shading.Color = Color.Parse(green);
row.Cells[4].AddParagraph("");
row.Cells[4].Shading.Color = Color.Parse(green);
}
row = table.AddRow();
row = table.AddRow();
row.Cells[0].AddParagraph("If specific measures have been taken to meet the requirements of OMB Memoranda M-06-15 and M-06-16 , note them here. ");
row.Cells[0].Borders.Visible = false;
row.Cells[0].Format.Alignment = ParagraphAlignment.Left;
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row.Cells[0].AddParagraph("Please explain in the text box");
row.Cells[0].Borders.Visible = false;
row.Cells[0].Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row.Cells[0].AddParagraph(string.IsNullOrEmpty(GetPIASection.txtResponse1) ? "" : GetPIASection.txtResponse1);
row.Cells[0].Shading.Color = Color.Parse(green);
row.Cells[0].Borders.Width = borderWidth;
row.Cells[0].Borders.Visible = true;
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row = table.AddRow();
row.Cells[0].AddParagraph("5.2 PRIVACY IMPACT ASSESSMENT: External sharing and disclosure");
row.Cells[0].Format.Font.Bold = true;
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row.Cells[0].AddParagraph("Discuss the privacy risks associated with the sharing of information outside the Department and what steps, if any, are currently being taken to mitigate those identified risks. ");
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row = table.AddRow();
row.Cells[0].AddParagraph("Discuss whether access controls have been implemented and whether audit logs are regularly reviewed to ensure appropriate sharing outside of the Department. For example, is there a Memorandum Of Understanding (MOU), contract, or agreement in place with outside agencies or foreign governments. Discuss how the sharing of information outside of the Department is compatible with the stated purpose and use of the original collection. ");
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row = table.AddRow();
row.Cells[0].AddParagraph(@"Follow the format below when entering your risk assessment:");
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row.Cells[0].AddParagraph(@"Privacy Risk: ");
row.Cells[0].Format.Font.Bold = true;
row.Cells[0].Format.Font.Underline = Underline.Single;
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row.Cells[0].AddParagraph(@"Mitigation: ");
row.Cells[0].Format.Font.Bold = true;
row.Cells[0].Format.Font.Underline = Underline.Single;
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row.Cells[0].AddParagraph("Please explain in the text box");
row.Cells[0].Borders.Visible = false;
row.Cells[0].Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].MergeRight = 4;
row = table.AddRow();
row.Cells[0].AddParagraph(string.IsNullOrEmpty(GetPIASection.txtResponse2) ? "" : GetPIASection.txtResponse2);
row.Cells[0].Shading.Color = Color.Parse(green);
row.Cells[0].Borders.Width = borderWidth;
row.Cells[0].Borders.Visible = true;
row.Cells[0].MergeRight = 4;
// Render this page
docRenderer = new DocumentRenderer(migDoc);
docRenderer.PrepareDocument();
gfx = XGraphics.FromPdfPage(page);
docRenderer.RenderObject(gfx, XUnit.FromCentimeter(1), XUnit.FromCentimeter(10), "25cm", table);[/color]
gfx.Dispose();
Thank you,
Chi Ming