Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
i want to convert image to pdf format with source code in c# windows application
without any other dll or third party source code.
Posted

I think below link will help you

Tutorials on creating PDF files using C# 2.0[^]
 
Share this answer
 
Comments
BobJanova 22-Jun-11 6:44am    
Good link, but iTextSharp is a text based engine, and will be only marginally useful for this question.
[no name] 22-Jun-11 7:10am    
Try this link
http://www.codeproject.com/KB/files/generatepdf.aspx
And? You are waiting for permission, perhaps? If so, then consider it given.

If not, then you will have to read up on the file spec for PDF files[^], and implement the relevant sections.
 
Share this answer
 
The you have to study the PDF specifications and implement yourself the algorithm.
The latest specifications available for free are the 1.7[^].
 
Share this answer
 
Well, good luck then. First of all, you are going to need a copy of the PDF specification[^]. Then you are going to need an awful lot of time, patience and caffeine.

Why do you need to write all this for yourself? There are several free libraries that you could use to perform this for you - without the headache of having to understand, write, test and bug-fix.
 
Share this answer
 
Raster images can't reasonably be 'converted' to PDF (without lots of clever code to recognise paths, text etc within an image). However, you can include an image in a PDF, and if that's all you want in the PDF, it is a fairly trivial one. JPEGs can be included verbatim, other formats you will have to construct the bitmap in simple 32 bit (might be 24, it's a while since I did this) format and then optionally compress it (gzip, use SharpZipLib for that in my opinion, I know that's third party but it's LGPL and good) before including it.

Vector images can be converted to PDF, and since vector image formats are generally based on PostScript, it is usually relatively easy to do so.

To create a PDF you need to understand the file format. Griff posted a link, but I recommend looking at one of the earlier versions of the spec located here[^], as the fewer features you have to learn the easier it is to create a working document. PDF 1.3 contains everything you are likely to want.
 
Share this answer
 
 
Share this answer
 
Comments
Pete O'Hanlon 23-Jun-11 3:20am    
As the OP stated he didn't want to use third party components (no idea why), this isn't going to be much use to him sadly. Good find though.

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