cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Convert jpg file in pdf

Solved!
Go to solution
Highlighted

Convert jpg file in pdf

Hi everyone.

I would like to convert a jpg file to pdf format.

The use of Ghostscript is preferable.

 

Tips?

0 Kudos
Message 1 of 11
(175 Views)

Re: Convert jpg file in pdf

Hi wall,

 

The use of Ghostscript is preferable.Tips?

Use GhostScript!

 

Is this question LabVIEW related? Or do you just want to read the GhostScript manual?

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 2 of 11
(168 Views)

Re: Convert jpg file in pdf

So everything you'll do with GS from the command line, you can do in LabVIEW with System Exec.vi... That is a missing peace that you won't find in the GS manual.

0 Kudos
Message 3 of 11
(152 Views)

Re: Convert jpg file in pdf

Thanks for the reply.

The idea is just to call GS using precisely System Exec.vi but I can not make it work properly.

In input I have the path where the jpg file is saved, the name with which I want to rename the pdf and the path where to save the pdf.

Any example ?

 

Best regards

0 Kudos
Message 4 of 11
(139 Views)

Re: Convert jpg file in pdf

Hi wall,

 

have you tried the same in a standard Windows command shell?

Does it work here?

Which command do you use?

 

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 5 of 11
(134 Views)

Re: Convert jpg file in pdf


@thewall1990 wrote:

 

Any example ?


Unlikely.

 

Does it work from the command line? That should be the first step.

 

If it does, then you only need to get the string passed to the System Exec.vi to match this string. I'd skip calling the System Exec.vi and use an indicator or popup to get it working. If that seems to be the problem, post what you have.

 

 

0 Kudos
Message 6 of 11
(132 Views)
Solution
Accepted by topic author thewall1990
01-13-2019 11:41 PM

Re: Convert jpg file in pdf

for the most simplest implementation is used jpeg2pdf.exe

Its a 43 kb executable.

 

Call is from cmd exec: cmd /c jpeg2pdf.exe "%s" -o "%s"

Where the first %s indicates the filename of the .jpg

2nd %s is the target path of the PDF

 

Location of .exe http://sourceforge.net/projects/jpeg2pdf/

Upside : no installation of other software required

Downside , the source .jpg file has to be in the same folder as the .exe to work.

Floris Reinders
Senior Project Engineer / CLA
0 Kudos
Message 7 of 11
(123 Views)

Re: Convert jpg file in pdf

Thanks for the reply, I have adopted the solution proposed by mr but I still have problems.

From Windows command shell it works correctly (as you can see in the picture "cattura1" attached) but when I go to implement it on LabVIEW, it gives me the error that I reported in the picture "cattura2".

What am I doing wrong?

 

Thanks for your help

0 Kudos
Message 8 of 11
(91 Views)

Re: Convert jpg file in pdf

Hi wall,

 

set the working directory with SysExec…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 9 of 11
(85 Views)

Re: Convert jpg file in pdf

Thanks for the help.

I solved the problem.

 

Very kind.

Wall

0 Kudos
Message 10 of 11
(80 Views)