empira / pdfsharp-samples-1.5 Goto Github PK
View Code? Open in Web Editor NEWA .NET library for processing PDF
License: MIT License
A .NET library for processing PDF
License: MIT License
I saw this: https://github.com/empira/PDFsharp-samples/blob/master/samples/gdi/GraphicsPreview/PreviewForm.cs
But I need for wpf mvvm version. Does pdfsharp support this? Please help
Hi, I want combine both sample for preview the mix pdf
https://github.com/empira/MigraDoc-samples/tree/master/samples/wpf/MixMigraDocAndPdfSharp
https://github.com/empira/MigraDoc-samples/tree/master/samples/wpf/DocumentViewer
But when preview, it only show data from Migradoc
Here is my code:
PdfDocument pdfDocument = new PdfDocument();
PdfPage page = pdfDocument.AddPage();
page.Size = PdfSharp.PageSize.A4;
page.Orientation = PdfSharp.PageOrientation.Landscape;
XGraphics gfx = XGraphics.FromPdfPage(page);
XFont fontH1 = new XFont("Arial", 18, XFontStyle.Bold);
XFont font = new XFont("Arial", 12);
XFont fontItalic = new XFont("Arial", 12, XFontStyle.BoldItalic);
double ls = font.GetHeight();
// Draw some text
gfx.DrawString("Create PDF on the fly with PDFsharp",
fontH1, XBrushes.Black, x, x);
Document doc = new Document();
var sec = doc.AddSection();
sec.PageSetup.Orientation = Orientation.Landscape;
sec.PageSetup.PageFormat = PageFormat.A4;
var para = sec.AddParagraph();
para.Format.Alignment = ParagraphAlignment.Justify;
para.Format.Borders.Color = Colors.AliceBlue;
para.AddText("Migradoc");
var docRenderer = new DocumentRenderer(doc);
docRenderer.PrepareDocument();
docRenderer.RenderObject(gfx, XUnit.FromCentimeter(5), XUnit.FromCentimeter(10), "12cm", para);
var ddl = DdlWriter.WriteToString(doc);
Preview.Ddl = ddl
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.