PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 2:28 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Nov 18, 2014 3:25 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
Hi all!

Some important facts about MigraDoc, PDFsharp, and PDF.

Let's start with MigraDoc
  • With MigraDoc, you create documents dynamically. At this stage, you have a document with sections, paragraphs, tables - but no pages. When the document is rendered to PDF, MigraDoc will create pages for you; when rendered to RTF, no pages are created until you use Word or another application to print the document; when rendering to HTML, you would get one file per section (rendering to HTML is currently not implemented).
  • Questions like "I don't know how much space I have left on my page" make no sense with Migradoc because pages do not (yet) exist when you create the document.
  • MigraDoc documents are highly dynamic, you can change anything at any time. You can add sections and tables. And finally you change the font size for style "Normal" from 10 to 14. MigraDoc adds the pagebreaks automatically when the document is rendered to PDF - and the table header will be repeated on every new page.
  • MigraDoc can be used in a different way: you can measure anything you add to the document, you can add page breaks when needed, you can start a new table with every new page to get a different table header for each page. This can be done, but MigraDoc was not designed to be used this way.

About PDFsharp
  • PDFsharp cannot render PDF - not on the screen, not on a printer.
  • PDFsharp cannot convert HTML or RTF to PDF (there is a third-party library on NuGet for HTML: "HTML Renderer for PDF using PdfSharp").
  • PDFsharp cannot convert PDF to HTML or RTF.

Finally information about PDF
  • PDF is a vector format. There are no pixels in a PDF file, there is no DPI. You can add raster images to a PDF file - and those images will have pixels and there will be horizontal and vertical DPI values, but text and lines etc. do not have pixels.
  • Dimensions are often specified in points. There are 72 points per inch. Point is just a unit, there are no pixels still. You can draw lines that are e.g. 0.5 or 0.25 points wide or even smaller. https://en.wikipedia.org/wiki/Point_(typography)

Some more information about Point vs. Pixel
There are 72 points in an inch. Points are a unit that measures distances. Points are not pixels.
Pixel means picture element, the smallest part of a raster image.

If the image has 72 DPI (dots per inch) then you have one dot per point. Each pixel will be one point wide and one point high.
If the image has 216 DPI (dots per inch) then you have three dots (pixels) per point. Each pixel will be one-third point wide and one-third point high.

Let's say picture A is 300 pixel wide at 300 DPI. The size of this image is one inch or 72 points.
Let's say picture B is 300 pixel wide at 100 DPI. The size of this image is three inches or 216 points.
Picture A has 4.167 pixels per point, picture B has 1.389 pixels per point.

If the term point gets you on the wrong track then maybe think of inches or centimeters.

Not all image formats have a DPI setting and not all images have it set. PDFsharp and MigraDoc use a default value for images without DPI setting.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri May 22, 2015 5:57 am 
Offline

Joined: Thu May 21, 2015 4:27 pm
Posts: 2
Hello Thomas,

You mentioned facts about MigraDoc and PDF, I guess you missed PDFSharp!

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Wed May 27, 2015 9:54 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
Hi!
er.ravi wrote:
I guess you missed PDFSharp!
No. Initially I planned to have two categories (MigraDoc and PDFsharp). When I added PDF as a third category, I had nothing left for PDFsharp, but I left it in the subject for future expansion.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 06, 2017 3:58 pm 
Offline

Joined: Mon Mar 06, 2017 3:55 pm
Posts: 1
Hi Thomas,

you mention the capability of MigraDoc to render to HTML, too; I cannot find information how to do this. Is there any documentation or examples how this is possible?

Thanks,
Fabian


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 06, 2017 4:44 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
Hi, Fabian!
knurdnerd wrote:
you mention the capability of MigraDoc to render to HTML
The current implementation does not support rendering to HTML.
The old version that supports HTML requires .NET 1.1 and is of little use on modern computers (I think .NET 1.1 cannot be used with Windows 8.1 or Windows 10).

There wasn't much demand for an HTML renderer in the past few years and I don't think there'll be a new HTML renderer in the next few years.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 75 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