Hi,
I am trying to use PDFsharp in 4gl and I am having difficulties converting code to to 4gl.
docs.pdfsharp.net
Anyone have an example or can help in converting this code?
At this moment I have difficult in xFontStyle and DrawString.
OpenEdge 12.2.12 | Windows 11
Baltazar
I am trying to use PDFsharp in 4gl and I am having difficulties converting code to to 4gl.
Home of PDFsharp andMigraDoc Foundation
Anyone have an example or can help in converting this code?
At this moment I have difficult in xFontStyle and DrawString.
Code:
// Create a new PDF document
PdfDocument document = new PdfDocument();
document.Info.Title = "Created with PDFsharp";
// Create an empty page
PdfPage page = document.AddPage();
// Get an XGraphics object for drawing
XGraphics gfx = XGraphics.FromPdfPage(page);
// Create a font
XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);
// Draw the text
gfx.DrawString("Hello, World!", font, XBrushes.Black,
new XRect(0, 0, page.Width, page.Height),
XStringFormats.Center);
// Save the document...
const string filename = "HelloWorld.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);
OpenEdge 12.2.12 | Windows 11
Baltazar