Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert a pdf image to a jpg image

Hi!

I have an application that uses OCR in a image. It works, but in jpg files and I need to read some pdf files as well.

 

Has anyone experienced similar situation?

 

Thank you!!

0 Kudos
Message 1 of 8
(3,911 Views)

If you are reading the images into LabVIEW, the format doesn't matter.  LabVIEW can read several formats interchangeably, and these are both included.

 

If you need to convert for another program, just read the PNG file into an image, then write the image to a JPG file.  I assume the picture control tools have the same option if you don't have the Vision module.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 8
(3,907 Views)

I'm using the IMAQ Read File vi.. should I read in another way? When I run it gives the folowing error:  -1074395991 IMAQ ReadFile
  NI Vision does not support the file type you specified.

 

Thank You!

 

Filipe Palma.

0 Kudos
Message 3 of 8
(3,875 Views)

Whoops - I read PDF as PNG the first time.  LabVIEW does not have a way to read a PDF file, because it isn't really an image.

 

The only way I can think of is to open the PDF file in a reader and copy the area you want to convert, then paste it into a paint program and save it as JPG.  Adobe Acrobat has the Snapshot function that works well - you just draw a box around the area you want and it is copied to the clipboard.

 

You could also use the print screen button to copy the whole screen, but that takes some editing to trim off the stuff you don't need after you paste it into a paint program.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 8
(3,872 Views)

Thank you Bruce! But I forgot to mention that I have many of this images to read, so the conversion should be automatic! If you have any idea I appreciate..

 

Thanks for you attention!

 

Filipe Palma.

0 Kudos
Message 5 of 8
(3,868 Views)

I did a Google search for "pdf to jpg" and found many utilities that look like they would do the job.  I suspect you could find one that could do it as a command line with arguments.  You could call it from LabVIEW whenever you needed to do a conversion.  There also might be a utility that lets you do a mass conversion of all your files at once.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 8
(3,864 Views)

Thank You! Good Idea 😉

0 Kudos
Message 7 of 8
(3,747 Views)

I should also suggest storing your images as PNG instead of JPG.  The distortion of JPG images can mess up your OCR application.  PNG images are usually distortion free, and might actually compress black and white images better.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 8 of 8
(3,739 Views)