PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 19, 2024 7:39 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Sep 12, 2011 9:31 pm 
Offline

Joined: Mon Sep 12, 2011 9:24 pm
Posts: 2
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!


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2011 7:11 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
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

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2011 7:27 pm 
Offline

Joined: Mon Sep 12, 2011 9:24 pm
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 14, 2011 6:39 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

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