PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Tue Dec 09, 2025 7:44 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Oct 12, 2012 6:15 pm 
Offline

Joined: Fri Oct 12, 2012 6:11 pm
Posts: 1
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? :-/


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 15, 2012 8:28 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3139
Location: Cologne, Germany
Also discussed here:
http://stackoverflow.com/a/12870266/162529

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 426 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group