pdf to jpg convertor ?

pdf to jpg convertor ?

Postby Richard Chidiak » Sat Nov 27, 2010 2:48 pm

Hello

I need to print a pdf "with my application" , i can print the pdf as a standalone with silent printing

But i need to be able to preview the pdf at the end of a particular report, i was thinking of converting the pdf to an image format like jpg and add a print page containing the jpg to that report

Does anyone know of a command line utility (silent) that can perform this task (convert the pdf to image format )?

nConvert is a perfect example but i am concerned about licensing as the tool will be shipped with my application,

Thanks for the help,

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: pdf to jpg convertor ?

Postby James Bott » Sun Nov 28, 2010 2:15 am

Richard,

But i need to be able to preview the pdf at the end of a particular report, i was thinking of converting the pdf to an image format like jpg and add a print page containing the jpg to that report


I don't understand what you are trying to do.

The standard report preview will look like the PDF if you have your print device set to a PDF printer driver. You do know about PDF printer drivers?

I don't understand why you want an image of the report in another report, or is it the same report? Is the report that you want an image of, only one page long?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: pdf to jpg convertor ?

Postby Richard Chidiak » Sun Nov 28, 2010 7:23 am

James

Maybe i did not express correctly my need

Let us say i have an invoice that is printed with my application, no matter how many pages it takes

Along with the invoice, our clients need to deliver "their customers" with a particular fiscal document , this document is a pdf document

So when i print the invoice , i need to print and preview the pdf document at the same time

I sure know about pdf printer drivers but that is not the need, i also use image2pdf that can convert the report to pdf but i need to print the whole together (invoice + pdf)

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: pdf to jpg convertor ?

Postby Otto » Sun Nov 28, 2010 7:54 am

Richard,

I use FASTREPORT for this task:


Code: Select all  Expand view
oFr:SetProperty("PDFExport", "FileName", ".\Report\" + ALLTRIM(str(seconds())) + ".pdf")
oFr:SetProperty("
PDFExport", "OpenAfterExport", .f.)
oFr:SetProperty("
PDFExport", "ShowDialog",.f.)
oFr:PrepareReport()

//i need to print and preview the pdf document at the same time

oFr:DoExport("
PDFExport")

 oFr:ShowReport()




Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: pdf to jpg convertor ?

Postby Richard Chidiak » Sun Nov 28, 2010 9:31 am

Otto

Thanks but this is not an option to me

My report is quite complex , i use the fwh print engine for it , not easy to port to fastreport

Thanks anyway,


Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: pdf to jpg convertor ?

Postby Otto » Sun Nov 28, 2010 10:16 am

Hello Richard,

Why? I do prepare all my reports in temp-dbf files.

When I convert an existing report I first fetch all the
print commands in a temp-dbf.

This way the reports in Fastreport designer are very easy to create.
I do nearly no calculations, etc. inside the reports.
For example
If I print an invoice I have the totals inside the temp-dbf files.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: pdf to jpg convertor ?

Postby James Bott » Sun Nov 28, 2010 7:15 pm

Richard,

OK, but I still do not understand why you need an image. Also, are you printing the PDF to the printer also? Or, just to a file?

You could print the PDF to a file, then print the PDF to the printer.

You could print to the printer, then print the PDF to a file.

Do you mean you need a preview before printing anything or?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: pdf to jpg convertor ?

Postby Richard Chidiak » Sun Nov 28, 2010 9:51 pm

James

Do you mean you need a preview before printing anything or

Yes i need to preview the whole together

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: pdf to jpg convertor ?

Postby James Bott » Mon Nov 29, 2010 4:35 pm

Richard,

Yes i need to preview the whole together


OK, but I am guessing that I still don't understand what the "whole" is. Are you talking about a printout and a PDF that are different things or the same thing?

If they are the same thing, then is seems you just need to do a preview, then print to a print device, then print to a PDF file.

If they are not the same thing, then please explain exactly what they are.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: pdf to jpg convertor ?

Postby Richard Chidiak » Mon Nov 29, 2010 9:30 pm

James

The original print out is an invoice generated from my app (fwh tprinter class) , so far so good

I need the ability to add to this invoice (print out) a pdf document before printing , so the final print out will be : original print out + pdf document , this will be the new print out that will be previewed and printed

This is why i need to convert pdf to jpeg , i can create a print out with a jpeg for the add on and then preview

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: pdf to jpg convertor ?

Postby James Bott » Tue Nov 30, 2010 5:28 am

Richard,

OK, so the PDF document is NOT the invoice? What is it? Is it already in existence when the report is printed or is it created when the report is printed.

Why does the PDF need to be a JPG? Are you using the report class or the printer class to generate your report? I'm not sure how you can add an existing PDF to a report that is being generated. Maybe you could add an image as a footer or maybe add a page feed then print the image as the last page.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: pdf to jpg convertor ?

Postby Richard Chidiak » Tue Nov 30, 2010 7:03 am

James

The pdf is not the invoice, it is a constant document that may or may not be present,

add a page feed then print the image as the last page

This is exactly what i want to do, and this is why i need to convert the pdf to an image format

I probably have found the solution with "xnview" that allows this conversion, i will place a purchase order today

Regards,

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: pdf to jpg convertor ?

Postby ukoenig » Wed Dec 01, 2010 6:50 pm

Richard,
You can have a look at GHOSTSCRIPT ( Freeware ) Version 9.0
There are many Informations in the Internet.
You can convert PDF to any Image-formats from Command-line ( You are looking for )
Inside Your Application You can call it with WINEXEC

Useful Informations :
http://pages.cs.wisc.edu/~ghost/doc/cvs/Use.htm

Sample Commands :

Convert Test.pdf to PNG for better Quality
--------------------------------------------------
WINEXEC ( "gs" -dSAFER -dBATCH -dNOPAUSE -r150 -sDEVICE=png16m -dTextAlphaBits=4 -sOutputFile=page -%02d.png Test.pdf )

Convert Test.pdf to JPG
----------------------------
WINEXEC ( "gs" -dNOPAUSE -sDEVICE=jpeg -r144 -sOutputFile=p%03d.jpg Test.pdf )

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: pdf to jpg convertor ?

Postby Richard Chidiak » Wed Dec 01, 2010 7:40 pm

Uwe

Thanks, i have already downloaded it and using it now , almost all pdf to image converter need ghostscript for this task.

To be more precise, i have downloaded a lite edition of ghostscrip that has an automatic silent installation process , important for my application no prompts or whatever

And in adjunction i have purchased a license to commercial use of nconvert.exe that allows me all grafic combinations.

So i convert direct from pdf to emf and add to my report the needed pages (the pdf can be in several pages, no problem), working like a charm !

Great product,

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], RSalazarU and 80 guests