Prev: 3D gridding
Next: Plzzzzz Help Me (runstr)
From: Mark on 10 May 2010 09:33 Hi there! I am trying to convert a PDF file to an image (which extension doesn't matter) with Matlab. Does anybody have an idea how to do this? Or could somebody tell me how to start with reading the PDF file into Matlab as some sort of image?
From: Mark Shore on 10 May 2010 10:30 "Mark " <markmatlab(a)gmail.com> wrote in message <hs91v2$ds9$1(a)fred.mathworks.com>... > Hi there! > > I am trying to convert a PDF file to an image (which extension doesn't matter) with Matlab. Does anybody have an idea how to do this? Or could somebody tell me how to start with reading the PDF file into Matlab as some sort of image? Adobe Acrobat can export pdf files in tif, jpg and png format. I assume other programs have similar functionality.
From: Mark on 10 May 2010 10:53 > Adobe Acrobat can export pdf files in tif, jpg and png format. I assume other >programs have similar functionality. I suppose so, but I want Matlab to transform this so users can select an PDF file and display it on a PSP-screen. I wrote the code to select an image with Matlab, transform it to RGB values, send it over a USB port to a PSP screen, but I can't do this with a PDF. That is why I need Matlab to read a PDF file as an image file. I found a function to transform text to an image, but it won't convert PDF files. Only other text files. This is that function: http://www.mathworks.com/matlabcentral/fileexchange/7952-text2image-convert-an-ascii-text-file-to-image Can anyone help me transform PDF's into images?
From: Steven Lord on 10 May 2010 11:58 "Mark " <markmatlab(a)gmail.com> wrote in message news:hs96kj$o5f$1(a)fred.mathworks.com... >> Adobe Acrobat can export pdf files in tif, jpg and png format. I assume >> other >programs have similar functionality. > > I suppose so, but I want Matlab to transform this so users can select an > PDF file and display it on a PSP-screen. I wrote the code to select an > image with Matlab, transform it to RGB values, send it over a USB port to > a PSP screen, but I can't do this with a PDF. That is why I need Matlab > to read a PDF file as an image file. > > I found a function to transform text to an image, but it won't convert PDF > files. Only other text files. This is that function: > > http://www.mathworks.com/matlabcentral/fileexchange/7952-text2image-convert-an-ascii-text-file-to-image > > Can anyone help me transform PDF's into images? What would you expect such a function to do if the PDF contains no images, only text? What if it contained both graphics and non-graphics content, like this one? http://www.mathworks.com/company/newsletters/news_notes/pdf/Fall96Cleve.pdf There are functions in MATLAB to export _to_ PDF, but I don't believe there are any to import _from_ PDF. You would need to create your own or search the File Exchange for one. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: Oliver Woodford on 10 May 2010 12:12
"Mark " wrote: > I am trying to convert a PDF file to an image (which extension doesn't matter) with Matlab. Does anybody have an idea how to do this? Or could somebody tell me how to start with reading the PDF file into Matlab as some sort of image? As people have stated, MATLAB doesn't have the ability to import pdfs. So you need to convert the pdf to an image, then import it. You can convert a pdf to an image using ghostscript (you'll need to search for the exact commands online). You can call ghostscript from MATLAB using the system function. However there is a function called ghostscript.m in the export_fig package (http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig) which makes this a bit simpler, especially if the ghostscript executable is not on the path. HTH, Oliver |