how to export images to pdf

26 次查看(过去 30 天)
Lukas
Lukas 2014-4-19
评论: Lukas 2014-4-20
heloo
i need to export a lot of images to pdf file. i tried this solutions but it is bad.
for a=1:2
h=subplot(2,1,a), imshow(absKoniec{a})
%in absKoniec are more then 2 images(pages of book), this is only example
kurnik = figure(1)
end
saveas(h,'hokus.pdf')
hgexport(kurnik, 'figure1.pdf', hgexport('factorystyle'), 'Format', 'pdf')
output is here:
images in pdf and in figure are too small(background is too big).so it is necessary to zoom in pdf. And how to do it, if i want to have one image on every single page of pdf (it is possible)? help me pls...
  2 个评论
Walter Roberson
Walter Roberson 2014-4-20
What did you set() the figure PageSize to be?
Lukas
Lukas 2014-4-20
do you thing this:
for a=1:30
h=subplot(30,1,a), imshow(absKoniec{a})
kurnik = figure(1)
end
%saveas(h,'hokus.pdf')
%hgexport(kurnik, 'figure1.pdf', hgexport('factorystyle'), 'Format', 'pdf')
%A = hgload('myFigure.fig');
% set desired output size
set(kurnik, 'Units','centimeters')
height = 15;
width = 4;
% the last two parameters of 'Position' define the figure size
set(kurnik, 'Position',[0 0 width height],...
'PaperSize',[width height],...
'PaperPositionMode','auto',...
'InvertHardcopy', 'off',...
'Renderer','painters'... %recommended if there are no alphamaps
);
%saveas(kurnik,'printout','pdf')
hgexport(kurnik, 'figure1.pdf', hgexport('factorystyle'), 'Format', 'pdf')
but if there(in figure) are many images, i need strong zoom to see images...

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by