PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Merge MigraDoc into XGraphics - where does paragraph end?
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1401
Page 1 of 1

Author:  ivjim [ Tue Nov 02, 2010 3:15 pm ]
Post subject:  Merge MigraDoc into XGraphics - where does paragraph end?

In reviewing the sample MixMigraDocAndPdfSharp sample I am trying to figure out how to determine where the MigraDoc paragraph ends in the XGraphics object. I have a fair bit of code that is built utilizing PDFSharp / XGraphics and would like to use MigraDoc's superior paragraph rendering in the middle of one of my pages. Unfortunately I can't determine where the paragraph ends.

Any ideas?

Author:  mikesowerbutts [ Fri Nov 05, 2010 3:05 pm ]
Post subject:  Re: Merge MigraDoc into XGraphics - where does paragraph end?

Hi,

You can integrate PdfSharp objects into migradoc, but not really the other way round. It was a hurdle i learned i had to jump after I tried to do almost everything with pdfsharp, then add in the functionality of migradoc later - i found that it was worth starting again and using migradoc for everything i could, and pdfsharp for the things i couldnt do with migradoc.

With regards to measuring paragraphs, there isnt really the concept of "Height" as they are just containers, which size according to the page they are displayed on and the other contents of that page. I raised the topic: http://forum.pdfsharp.net/viewtopic.php?f=2&t=780#p1904 a while ago which might help you.

But my case for doing this was that I had a migradoc table, which I wanted to draw a simple "progress bar" graphic into with pdfsharp (in a specific cell). The solution Thomas Hoevel came up with pretty much worked (although i could never get it to be 100% accurate with the measurements and it took quite a while to get it all right). But i later discovered that it was basically easier to create a new PdfDocument, add a page with a custom size (i.e. the output size of the image i was creating) draw onto that, then save that as a .pdf, then load the .pdf into the migradoc cell object and let migradoc worry about the positioning.

Hope this helps,

Mike

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