Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
hi..,
can we save any file uploaded as a.jpg file i.e.., can we convert first page of any document in to .jpg and save in a folder using c# if u have any code plz help me

i want to show preview of my document before the user download it and i want that preview to be a jpg image so that we can show the preview with out much time and bandwidth
Posted
Updated 20-Nov-11 23:58pm
v2
Comments
Sergey Alexandrovich Kryukov 21-Nov-11 2:06am    
What kinds of document?
--SA
rajeevcapgeminiindia 21-Nov-11 2:09am    
Please clarify your question by an example.
RaviRanjanKr 21-Nov-11 2:29am    
Your Question is not very clear. please be more specific while asking question. we need more information about your question.

"Any file" and the notion of a document are contradicting: some files won't be documents.

Also, many document formats does not have any fixed bitmap rendering. For example, a particular look of a Windows Word document will depend on the size of the application windows, view options, zoom and other factors. Also, the notion of "first page" also depends on those factors. For example, "Web layout" does not show pages". However, I understand that you need this bitmap as a "preview" of a document. If so, one can select some arbitrary fixed way of rendering for each document type.

Now, there is another problem: "any document" sounds like "any document of any document type/format", as you did not specify required types. This sound a bit unrealistic, to say the least. You need to curb you appetite for a comprehensive solution somehow.

—SA
 
Share this answer
 
v2
If you want to convert a web page to an image, refer this
http://stackoverflow.com/questions/701680/how-do-i-save-a-web-page-to-image[^]
and for any image to jpg refer this
http://stackoverflow.com/questions/41665/bmp-to-jpg-png-in-c-sharp[^]
 
Share this answer
 
v2

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