Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142895 | Feb 25,2019 11:00 AM UTC | Feb 26,2019 01:15 PM UTC | Xamarin.Forms | 1 |
![]() |
Tags: PDF |
using (PdfDocument document = new PdfDocument()) { //Add a page PdfPage page = document.Pages.Add(); //Acquire pages graphics PdfGraphics graphics = page.Graphics; //Declare a PdfLightTable PdfLightTable pdfLightTable = new PdfLightTable(); //Add values to list List<object> Questions = new List<object>(); for (int i = 0; i < NumberOfQuestion; i++) { LeftOperant = LeftOperantList[i]; RightOperant = RightOperantList[i]; result = Calculation(LeftOperant, Operator, RightOperant); object row = new { Value1 = LeftOperant, Value2 = Operator, Value3 = RightOperant, Value4 = result }; Questions.Add(row); } //Add list to IEnumerable IEnumerable<object> table = Questions; //Assign data source. pdfLightTable.DataSource = table; //Draw the PdfLightTable pdfLightTable.Draw(page, PointF.Empty); //Save the document MemoryStream stream = new MemoryStream(); document.Save(stream); document.Close(true); } |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.