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

Generating a detailed document
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1781
Page 1 of 1

Author:  Schuyler [ Mon Sep 12, 2011 9:31 pm ]
Post subject:  Generating a detailed document

I am attempting to compile several .txt files, formatted (indented, paragraphs etc.), into a pdf document. I need to have a bold title at the top, with slightly larger font than the rest of the document, and the an image under the title. After the image, it will begin loading the .txt files and adding them. There is no set length of the articles, and they may require more than one page. But the documents do need to be 8.5" x 11". I assume the .txt files will need to be in some sort of foreach or while statement, as there is no set number of documents that will need to be loaded.

So, this sounds simple enough in my mind, but actually putting it into play has been a COMPLETELY different story. I am completely and utterly lost. Anyone have any code snipits or suggestions that might help out? I am using C#. Thanks in advance!

Author:  Thomas Hoevel [ Tue Sep 13, 2011 7:11 am ]
Post subject:  Re: Generating a detailed document

Using MigraDoc you just have to open each file, extract the text paragraph by paragraph and add each paragraph to a MigraDoc document.
All pages will have the same size and MigraDoc starts a new page when it's needed.

MigraDoc samples:
http://www.pdfsharp.net/wiki/MigraDocSamples.ashx

Author:  Schuyler [ Tue Sep 13, 2011 7:27 pm ]
Post subject:  Re: Generating a detailed document

I have looked through the example codes, but am still somewhat confused about actually adding the text. Is there a command to add text to an existing rectangle? So that I could do a foreach statement to add each text document to the document...

Thanks again,
Schuyler

Author:  Thomas Hoevel [ Wed Sep 14, 2011 6:39 am ]
Post subject:  Re: Generating a detailed document

Schuyler wrote:
Is there a command to add text to an existing rectangle?

With MigraDoc you define page margins. So every page has a rectangle where text can be added - flowing over to the next page if needed.

I'm not sure if that's what you want, but that's what I'd use.

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