Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to create a .pdf document from text (datarow , .txt file or string). e.g. I have an entry in a database , i want to save a single row/column/cell as an entire page in pdf format (as a pdf file).

Im also trying to avoid using 3rd party tools or .dlls. Any help would be appreciated.

Thanks.
Posted
Updated 31-Oct-11 4:46am
v2
Comments
Menon Santosh 31-Oct-11 14:18pm    
I think 3rd party tools/Dlls can save lots of Ur labour, i suggest U itextsharp for this

If you want to totally avoid 3rd party tools/DLLs (including pdf printer drievrs), then you'd have to manually implement a PDF writer (a mammoth task that may need several man months). I'd suggest that you reconsider your decision regarding using a 3rd party lib/tool/driver.
 
Share this answer
 
Comments
BobJanova 31-Oct-11 11:50am    
Writing a simple PDF writer isn't that large a task ... days or weeks not months, even starting from fresh start. As long as you don't want to do anything advanced, the format is quite simple. It's probably still the wrong way to go though.

This reminds me, I have a piece of code that does this which would make a nice article.
Nish Nishant 31-Oct-11 11:51am    
I agree, specially if he just has plain text data.
Sergey Alexandrovich Kryukov 31-Oct-11 13:42pm    
I agree with that, too, but OP said "to avoid using 3rd party tools or .dlls". It does not mean "avoid 3rd-part source code", right? So, I recommended an Open Source solution, please see.
--SA
Nish Nishant 31-Oct-11 13:44pm    
I would consider source code to be a "tool" of sorts too when I refer to it as 3rd party, but you may be right SA :-)
Espen Harlinn 31-Oct-11 16:07pm    
5'ed :)
You see, if you want to avoid 3-rd party libraries, you maybe bound to creation of your own. Could you afford it? However, if you want to use only 3rd-part source code but not precompiled executables, this is very reasonable. I would recommend to use iTextSharp. This is a .NET port of iTextSharp, an Open Source library used to work with PDF.

See:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^] (you can download iTextSharp here).

Good luck,
—SA
 
Share this answer
 
Comments
Nish Nishant 31-Oct-11 13:44pm    
Good alternatives. My vote of 5.
Sergey Alexandrovich Kryukov 31-Oct-11 13:47pm    
Thank you, Nishant.
--SA
Espen Harlinn 31-Oct-11 16:07pm    
5'ed :)
Sergey Alexandrovich Kryukov 31-Oct-11 16:26pm    
Thank you, Espen.
--SA
Monjurul Habib 31-Oct-11 16:24pm    
my 5!
There is no way to do what you want with .pdf without a library or a bunch of work. Winovative has good libraries that are automatic with zero coding for html conversion.

I recommend using excel instead of pdf format. Your still going to have to have a html wrapper though.

Here is a link to a way to convert HTML to excel. http://www.codeproject.com/Tips/272244/Export-any-page-to-excel-automatically-asp-net
 
Share this answer
 
Hi guys ... thanks for your posts... after thorough investigation , it is evident that creating a whole tool would be tedious. I am going through some 3rd party tools...particually iTextSharp. Thanks once again for your views and help. Much Appreciated.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900