sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    New Developer Export to PDF can it be done?

    Scheduled Pinned Locked Moved Developers' Forum
    11 Posts 6 Posters 397 Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dan RathbunD Offline
      Dan Rathbun
      last edited by

      either Model#export()

      or View#write_image()

      You need to learn the basics of standard Ruby to use the SketchUp API.
      (see link below)

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • U Offline
        umen
        last edited by

        Thanks , but i didn't found any option to export to pdf .
        maybe i missing something ?

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          None of them let you export to PDF.

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            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's UI.openURL(path2jar) on that file...
            Not sure how easy it is to do... πŸ˜•

            TIG

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              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

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                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.)

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • bomastudioB Offline
                  bomastudio
                  last edited by

                  @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?

                  1 Reply Last reply Reply Quote 0
                  • Dan RathbunD Offline
                    Dan Rathbun
                    last edited by

                    @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:")

                    πŸ’­

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • bomastudioB Offline
                      bomastudio
                      last edited by

                      Thank you Dan, as usual you are very quick and accurate!! πŸ‘ πŸ‘

                      Sketchup.send_action("printDocument;")
                      

                      ❓ Where you find it?? ❓

                      1 Reply Last reply Reply Quote 0
                      • Dan RathbunD Offline
                        Dan Rathbun
                        last edited by

                        @bomastudio said:

                        Sketchup.send_action("printDocument;")
                        

                        ❓ Where you find it?? ❓

                        In the Code Snippet post:
                        Re: [Code] Sketchup.send_action() : Arguments to

                        Lots of snippets indexed here: [Code Snippets]

                        πŸ’­

                        I'm not here much anymore.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement