Hi,
I'm starting to get very frustrated about the print tools in Matlab. To illustrate my problem, I have the following code
I = rand(200,250,3);
imshow(I);
set(gcf,'PaperUnits','points');
set(gcf,'PaperSize',[250 200]);
print(gcf,'test.pdf','-dpdf');
i.e. I plot something with imshow, set the paper size to be 250 x 200 points and then print to 'test.pdf'. When I check the pdf in Acrobat Reader the size is 70.6 x 70.6 mm corresponding to 200 x 200 points.
Why is the paper size set to 200 x 200 instead of 250 x 200 as I have specified? If I fiddle around with the specified paper size, sometimes I get the correct size and sometimes I don't.
Any help is most welcome!
Regards,
Fredrik
|
|
0
|
|
|
|
Reply
|
Fredrik
|
4/22/2010 7:27:24 PM |
|
It seems that the pdf printer does not process the PaperSize settings properly. A workaround is to create an eps file first, and then convert it to pdf, e.g.:
function exportFigure(fileName, resolution)
print('-depsc2', sprintf('-r%d', resolution), [fileName '.eps']);
system( ...
sprintf( ...
'epstopdf --gsopt=-dPDFSETTINGS=/prepress --outfile=%s.pdf %s.eps', ...
fileName, fileName));
system(sprintf('del %s.eps', fileName)); % delete temporary .eps file
end
|
|
0
|
|
|
|
Reply
|
Twan
|
3/5/2011 5:19:04 PM
|
|
|
1 Replies
496 Views
(page loaded in 0.24 seconds)
Similiar Articles: Paper size not as specified! Print to PDF - comp.soft-sys.matlab ...Hi, I'm starting to get very frustrated about the print tools in Matlab. To illustrate my problem, I have the following code I = rand(200,250,3); ... How to print true size on smaller paper? - comp.text.pdf ...Paper size not as specified! Print to PDF - comp.soft-sys.matlab ... How to print true size on smaller paper? - comp.text.pdf ... Dear friends The PDF document is A3 (420 ... Printing a single page document twice on the same page - comp.text ...Paper size not as specified! Print to PDF - comp.soft-sys.matlab ... Printing a single page document twice on the same page - comp.text ... Paper size not as specified! Paper tray selection when printing a PDF file - comp.text.pdf ...Paper size not as specified! Print to PDF - comp.soft-sys.matlab ... The result of this is that Acrobat will print PDF files (by default) on the paper size specified in ... Acrobat Reader and defaut paper size - comp.text.pdfPaper size not as specified! Print to PDF - comp.soft-sys.matlab ... Acrobat Reader and defaut paper size - comp.text.pdf How to print true size on smaller paper? - comp ... print pdf : can I select smaller font? - comp.text.pdfPaper size not as specified! Print to PDF - comp.soft-sys.matlab ... How to print true size on smaller paper? - comp.text.pdf ... Dear friends The PDF document is A3 (420 ... Want to print pages of a pdf to different trays of a printer ...Paper size not as specified! Print to PDF - comp.soft-sys.matlab ... programmatically print PDF and specify printer, page size ... I need to be able to print PDF files to ... Change resolution / page size in image only PDF? - comp.text.pdf ...Paper size not as specified! Print to PDF - comp.soft-sys.matlab ..... convert it to pdf, e.g.: function exportFigure(fileName, resolution ... Why do Image Size ... PDF scaling - comp.os.linux.miscPaper sizes in FPDF - comp.lang.php Change PDF Page Size ... to Reduce PDF Size | eHow.com The Portable Document Format ... misc... specify printer, page size, and ... pdf ... Paper size not as specified! Print to PDF - comp.soft-sys.matlab ...Hi, I'm starting to get very frustrated about the print tools in Matlab. To illustrate my problem, I have the following code I = rand(200,250,3); ... Paper size not as specified! Print to PDF - Newsreader - MATLAB ...Hi, I'm starting to get very frustrated about the print tools in Matlab. To illustrate my problem, I have the following code I = rand(200,250,3); 7/22/2012 1:53:37 PM
|