我正在嘗試將高解析度影像(30 英寸寬 x 60 英寸高)轉換為 MATLAB 中的 pdf 檔案。我嘗試了在線列印、匯出圖形和幾個腳本,但我一直得到低質量的輸出。我也嘗試將解析度設定為 300dpi,但它不起作用。如果您有任何建議,請與我分享,我會測驗。非常感謝!
使用的影像檔案(重命名為 map.png):https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Political_map_of_the_World_(January_2015).svg/9444px-Political_map_of_the_World_(January_2015).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
uj5u.com熱心網友回復:
我設法通過匯入pdfbox(java)并將影像作為緩沖影像匯入然后使用pdmodel.PDDocument創建一個檔案然后使用bufferedimage.getWidth添加一個具有自定義大小并且長度相同的頁面然后我將緩沖影像流式傳輸到頁面并將檔案保存為 pdf 檔案。代碼在我的作業電腦上,如果有人感興趣,我會在這里復制。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/437395.html
上一篇:使用MATLAB的廣義特征值問題
