New Developer Export to PDF can it be done?
-
Hello all
im new to SketchUp pro , and in my job i need to develop some plugins to it .
first question is , can i export scene to PDF via code ? c++ or rubi.
if someone can send me link to reference or tutorial this will be great
Thanks allot for your help. -
either Model#export()
You need to learn the basics of standard Ruby to use the SketchUp API.
(see link below) -
Thanks , but i didn't found any option to export to pdf .
maybe i missing something ? -
None of them let you export to PDF.
-
You can write a
.jar
file that in turn uses Java code that makes a PDF [there are several libraries that do this - iText jar?] - perhaps from the data gleaned from an exported 'image file' [?]... then you can use API'sUI.openURL(path2jar)
on that file...
Not sure how easy it is to do... -
I assume you mean 3D PDF, if so, you can buy a plugin that already does that.
http://www.simlab-soft.com/3d-plugins/3D-PDF-from-sketchup-main.aspx
john
-
Sorry, I assumed since it was on the menu that the export method would honor the ".pdf" file extension (at least for Pro editions.)
Just a thought.. if one has a PDF "Virtual" Printer installed (like a Fax Printer, or the MS XPS Printer,) perhaps a "print to file" scenario might work. (My Dad uses one of these fake PDF printers to create PDF files on his office desktop.)
-
@dan rathbun said:
Sorry, I assumed since it was on the menu that the export method would honor the ".pdf" file extension (at least for Pro editions.)
Just a thought.. if one has a PDF "Virtual" Printer installed (like a Fax Printer, or the MS XPS Printer,) perhaps a "print to file" scenario might work. (My Dad uses one of these fake PDF printers to create PDF files on his office desktop.)
Hi Dan, I'm reading now this old post.
How I can access to printer from APIs? -
@bomastudio said:
@dan rathbun said:
How I can access to printer from APIs?
Your cannot directly access the printer itself... But you can access the model's print settings.
The "PrintOptions" provider keys (with MY default settings):
PrintWidth ................: 8.5 PrintHeight ...............: 11.0 ComputeSizeFromScale ......: false SizeInPrint ...............: 1.0 SizeInModel ...............: 1.0 VectorMode ................: false FitToPage .................: true NumberOfPages .............: 1 LineWeight ................: 0.5 PixelsPerInch .............: 150.0 SectionSlice ..............: false ModelExtents ..............: true PrintQuality ..............: 0 ScaleAdjustment ...........: 1.0 QualityAdjustment .........: 1.0
- YOUR default settings may vary depending upon the model template used.
Change or read printing options:
opts = Sketchup.active_model.options printing = opts["PrintOptions"] # Example; change fit to page option; printing["FitToPage"]= false
Click the menu item by doing this:
Sketchup.send_action("printDocument:")
-
Thank you Dan, as usual you are very quick and accurate!!
Sketchup.send_action("printDocument;")
Where you find it??
-
@bomastudio said:
Sketchup.send_action("printDocument;")
Where you find it??
In the Code Snippet post:
Re: [Code] Sketchup.send_action() : Arguments toLots of snippets indexed here: [Code Snippets]
Advertisement