Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145472 | Jun 24,2019 11:08 AM UTC | Jun 28,2019 07:31 AM UTC | UWP | 3 |
![]() |
Tags: Pdf |
//Create a text element
PdfTextElement element = new PdfTextElement(text, font);
element.Brush = new PdfSolidBrush(Color.Black);
element.StringFormat = format;
element.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set the properties to paginate the text.
PdfLayoutFormat layoutFormat = new PdfLayoutFormat();
layoutFormat.Break = PdfLayoutBreakType.FitPage;
layoutFormat.Layout = PdfLayoutType.Paginate;
//Draw the text element with the properties and formats set.
PdfTextLayoutResult result = element.Draw(page, bounds, layoutFormat);
// Set bounds of next text based on last layout bounds
bounds = new RectangleF( result.LastLineBounds.X , result.LastLineBounds.Y+20, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height);
// Use the PdfTextLayoutResult Page propoerty whihch gets the last layout page after pagination.
element.Draw(result.Page, bounds, layoutFormat);
|
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.