我试图将高分辨率图像(30英寸宽x 60英寸高)转换成一个pdf文件在MATLAB中。我试过打印、输出图形和在线上的几个脚本,但是我的输出质量一直很低。我还试着把分辨率设置为300 the,但没有起作用。如果你有任何建议,请与我分享,我会测试。非常感谢!
使用的图像文件(重命名为map.png):https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Political_map_of_the_World_%28January_2015%29.svg/9444px-Political_map_of_the_World_%28January_2015%29.svg.png
使用MATLAB命令:
world=imread('map.png');
imshow(world)
exportgraphics(gcf,'world.pdf','ContentType','vector','Resolution',300)
#Texts in picture is blurry
print -dpdf 'world.pdf'
#Texts in picture is still blurry
exportfig(gcf, 'world.pdf', 'format','pdf','Resolution', 300,'Renderer', 'painters');
#this is a script from the MATLAB file exchange. Texts still blurry发布于 2022-03-03 13:37:19
我成功地做到了这一点:导入pdfbox (java)并将图像导入为缓冲区,然后使用pdmodel.PDDocument创建一个文档,然后使用bufferedimage.getWidth添加一个具有自定义大小的页面,长度相同,然后流到页面中并将文档保存到一个pdf文件中。代码在我的工作PC上,如果有人感兴趣,我会在这里复制它。
https://stackoverflow.com/questions/71296625
复制相似问题