how to save an image in pdf format without blank space. i,e; size of pdf should be same as the size of the image
50 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Réponse acceptée
Plus de réponses (1)
Ameer Hamza
le 10 Mar 2020
Although Friedrich's answer here: https://www.mathworks.com/matlabcentral/answers/12987-how-to-save-a-matlab-graphic-in-a-right-size-pdf#answer_17755 provides a clean solution, It still leave some extra white spaces.
I personally prefer to print the file to eps format. It leaves absolutely no extra space
print(gcf, 'filename', '-depsc')
And then export the eps file to pdf using epstopdf (command-line tool available with the installation of latex). If you don't have epstopdf installed, you can use this link: https://www.zamzar.com/convert/eps-to-pdf/ to convert the files to pdf.
The following image shows the difference between both methods. First is according to Friedrich's answer, second, when it is created using the above method.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/276321/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/276322/image.png)
0 commentaires
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!