Giter Site home page Giter Site logo

pdfsharp-samples-1.5's People

Contributors

th-soft avatar thomashoevel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdfsharp-samples-1.5's Issues

Preview Mix MigraDoc And PdfSharp

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.