api-issue-tracker icon indicating copy to clipboard operation
api-issue-tracker copied to clipboard

PDF export physical size on Mac

Open Eneroth3 opened this issue 6 years ago • 3 comments

Not sure if this is a bug or a documentation error.

I can't get PDFs to export to a defined height on Mac. This is needed in my Scaled Perspectives2 extension to export drawings to scale.

The documentation neither specifies a unit or a data type for the imageHeight setting, but logically one of these 4 exports aught to be 10 times the height of one of the others. Yet they are all the same size.

dir = UI.select_directory
Sketchup.active_model.export(
  "#{dir}/pdf size test 1.pdf",
  imageHeight: 1
)
Sketchup.active_model.export(
  "#{dir}/pdf size test 1.0.pdf",
  imageHeight: 1.0
)
Sketchup.active_model.export(
  "#{dir}/pdf size test 10.pdf",
  imageHeight: 10
)
Sketchup.active_model.export(
  "#{dir}/pdf size test 10.0.pdf",
  imageHeight: 10.0
)

On Windows you can do the following to export a PDF to a defined size.

path = UI.savepanel("Export PDF")
path = "#{path}.pdf" unless path.end_with?(".pdf")
Sketchup.active_model.export(
  path,
  height_units: Length::Inches, # Length::Millimeter not supported.
  window_height: 20.0 # Integer and Length not supported.
)

Forum thread: https://forums.sketchup.com/t/does-the-pdf-exporter-even-accept-settings/110582/7

Eneroth3 avatar Dec 09 '19 08:12 Eneroth3

@nickAtSketchUp or @hilliard-sketchup - any ideas about this one?

thomthom avatar Dec 18 '19 11:12 thomthom

Hilliard_Scott, said in post:11, topic:110582 ...

There are errors in the documentation for PDF export on Mac. The options linked to pdf export are named: image_height (not imageHeight) image_width (not imageWidth) line_weight

DanRathbun avatar Dec 19 '19 14:12 DanRathbun

SU-45220

jinyistyle avatar Jan 21 '20 21:01 jinyistyle

Closing this issue as fixed with SU2026.0 for Mac.

kalpana-ghodeswar avatar Dec 01 '25 14:12 kalpana-ghodeswar