File tree 2 files changed +3
-10
lines changed
src/client/datascience/plotting
2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 1
- If require, use a custom paper size when exporting plots to ` PDF `
1
+ Use a custom paper size when exporting plots to ` PDF `
Original file line number Diff line number Diff line change @@ -169,15 +169,8 @@ export class PlotViewer extends WebViewHost<IPlotViewerMapping> implements IPlot
169
169
) ;
170
170
const options : Record < string , { } > = { } ;
171
171
if ( dimensions && dimensions . width && dimensions . height ) {
172
- const LetterSize = { width : 612 , height : 792.0 } ; //https://github.com/foliojs/pdfkit/blob/master/lib/page.js#L62
173
- // If the default LETTER size is smaller than image, then use a custom paper size.
174
- // This ensuresimages are not cropped.
175
- if ( dimensions . width > LetterSize . width || dimensions . height > LetterSize . height ) {
176
- options . size = [
177
- Math . max ( dimensions . width , LetterSize . width ) ,
178
- Math . max ( dimensions . height , LetterSize . height )
179
- ] ;
180
- }
172
+ // Ensure image fits, hence use our own size.
173
+ options . size = [ dimensions . width , dimensions . height ] ;
181
174
}
182
175
const doc = new pdfkit ( options ) ;
183
176
You can’t perform that action at this time.
0 commit comments