Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 31-Oct-11 4:43am
Rico_5.7K
Edited 31-Oct-11 4:46am
RaisKazi32.9K
v2
Comments
Menon Santosh at 31-Oct-11 14:18pm
   
I think 3rd party tools/Dlls can save lots of Ur labour, i suggest U itextsharp for this
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
BobJanova at 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.
Nishant Sivakumar at 31-Oct-11 11:51am
   
I agree, specially if he just has plain text data.
SAKryukov at 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
Nishant Sivakumar at 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 at 31-Oct-11 16:07pm
   
5'ed :)
Monjurul Habib at 31-Oct-11 16:24pm
   
my 5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
Comments
Nishant Sivakumar at 31-Oct-11 13:44pm
   
Good alternatives. My vote of 5.
SAKryukov at 31-Oct-11 13:47pm
   
Thank you, Nishant.
--SA
Espen Harlinn at 31-Oct-11 16:07pm
   
5'ed :)
SAKryukov at 31-Oct-11 16:26pm
   
Thank you, Espen.
--SA
Monjurul Habib at 31-Oct-11 16:24pm
   
my 5!
SAKryukov at 31-Oct-11 16:25pm
   
Thank you, Monjurul. I haven't heard from you for a while...
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 718
1 OriginalGriff 450
2 CPallini 415
3 George Jonsson 231
4 Richard Deeming 145
0 OriginalGriff 5,450
1 CPallini 4,500
2 Sergey Alexandrovich Kryukov 4,032
3 George Jonsson 3,057
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 1 Nov 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100