PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

MigraDOC generating a blank PDF
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2165
Page 1 of 1

Author:  KallDrexx [ Fri Oct 12, 2012 6:15 pm ]
Post subject:  MigraDOC generating a blank PDF

I am trying to get up and running with MigraDoc, but am having issues getting even the basic examples working. For example, when I run the following method in my asp.net application, the PDF I get sent is completely blank:

Code:
        public static MemoryStream Test()
        {
            var document = new Document();
            //document = CreateDocument();
           
            document.Info.Title = "Test Report";
            document.Info.Subject = "blah";
            document.Info.Author = "Me";

            var section = document.AddSection();
            var p = section.AddParagraph("test");
            p.AddText("Testing 1234");

            var renderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always);
            renderer.Document = document;
            renderer.RenderDocument();

            var ms = new MemoryStream();
            renderer.PdfDocument.Save(ms, false);
            return ms;
        }


When I copy all the methods from the tutorial at http://www.pdfsharp.net/wiki/HelloMigraDoc-sample.ashx I also get a blank PDF. In the latter case while the PDF is blank it is 6 pages in length (which seems to be correct) and all the bookmarks are appearing correctly, but for some reason all the pages are blank.

In the former case, even though the PDF is blank the properties are correctly what I set them.

Any ideas? :-/

Author:  Thomas Hoevel [ Mon Oct 15, 2012 8:28 am ]
Post subject:  Re: MigraDOC generating a blank PDF

Also discussed here:
http://stackoverflow.com/a/12870266/162529

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/