print to pdf and got it cropped

3 views (last 30 days)
Carlos Macedo
Carlos Macedo on 28 Jun 2016
Edited: Carlos Macedo on 28 Jun 2016
Good day to everyone.
Basically, the problem is that after using the 'print' function to export as '.pdf', i got the figure on it cropped.
1st. for printing i used the following:
%My figure handle was named as 'hfig1'
%Margins
SupMargin= 1.0;
InfMargin= 1.1;
LeftMargin= 2.0;
RightMargin= 0.2;
% Settings to print in A3 landscape paper
PaperWidth= 42.0;
PaperHeight= 29.7;
Width= PaperWidth-LeftMargin-RightMargin;
Height= PaperHeight-SupMargin-InfMargin;
set(hfig1, 'PaperUnits','centimeters');
set(hfig1, 'PaperSize',[PaperWidth PaperHeight]);
set(hfig1, 'PaperPosition',[LeftMargin InfMargin Width Height]);
set(hfig1, 'PaperOrientation','landscape');
print '-dpdf' '-r800' 'PDFfileName.pdf';
winopen 'PDFfileName.pdf';
2nd. After being executed i got a half cropped figure from beneath. The weirdest thing is that if after all the script is executed, and then i (first) bring the figure window to the front, and (next) i execute just the 'print' script part , it works like a charm (great!!)...
However, i don't want that to happen because all my scripts (others similars) were tought to run like "calculate...plot...print....save...gotonextscript". As a batch i think.
To add relevant information:
-Matlab R2014a 64bit is used
-Each of my scrips has 1500 lines aprox
-Even if '-r0' DPI is used for printing, the result is the same
-Figure has [4x5] suplots in it
That's all. Please, some help. Have a good day

Answers (0)

Categories

Find more on Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!