AA

Featured products

    Popular categories

      Trending searches

        Articles

          Blog

            Products

              Categories

                Suggested searches

                  Searching…
                  No results
                  Something went wrong.
                  ↑↓ Select↵ OpenEsc Close search
                  • English
                  • Čeština
                  • Deutsch
                  • Español
                  • Français
                  • Italiano
                  • Polski
                  • 日本語
                  • Orders
                  • Address
                  • In-stock Alerts
                  • My Courses
                  • Subscription
                  • Edit Account
                  • 3D printers9+▾

                    3D printersnew

                    newPrusa CORE One L+Learn more
                    newPrusa CORE One+ (Gen 2)Learn more
                    newPrusa CORE One L+ INDX 8-ToolnewPrusa CORE One+ (Gen 2) INDX 8-ToolPrusa CORE One L+: Critical InfrastructureOriginal Prusa MK4SnewOriginal Prusa XL+Original Prusa XL+: Critical Infrastructure

                    Printer upgrades

                    newINDX Conversion KitsnewPrusa CORE One L to CORE One L+ upgradenewPrusa CORE One+ to Prusa CORE One+ (Gen 2)newPrusa XL to Prusa XL+ Upgrade
                    Prusa Reward ProgramLove your Prusa printer? Share your experience and earn $30 Prusa e-shop vouchers.
                    How to Choose a 3D Printer?We’ll walk you through the basics to find the exact machine for your space, budget, and ideas.
                    Free E-bookDownload a free e-book Basics of 3D Printing with Josef Prusa and make your first steps in 3D printing world
                    Original Prusa Printable PartsCollections of printable spare parts for Original Prusa 3D printers and upgrades.
                    Shipping informationRegularly updated info about the current manufacturing capacity and delivery times of our printers.
                    Custom 3D PrintingProfessional custom 3D printing from various materials according to your requirements.
                  • Materials▾

                    Filaments

                    PrusamentPLAPETGASA / ABSPC (Polycarbonate)PA (Nylon)FlexCompositesSpecialMaterials clearance sale

                    Resin

                    Prusament ResinResin Cleaner
                    Filament GuideCheck my Prusament Spool
                    Prusament.com
                  • Parts & Accessories▾

                    Accessories

                    EnclosuresNozzlesPrint SheetsEssential AccessoriesCameras & AddonsTools & CraftingAdhesives

                    Spare parts

                    Merchandise

                    Spare parts - All PrintersCORE OneMK4/S & MK3.9/SMK3/S/+XL
                    Merch
                  • For Business▾
                    Prusa Pro HT90Prusa Pro SLXPrusa Pro AFSPrusa Pro Medical OneOriginal Prusa XLOriginal Prusa XL: Critical Infrastructure
                    Prusa CORE One+Learn more
                    Prusa CORE One LLearn more
                    Prusa CORE One L: Critical Infrastructure Edition

                    3D Printing for

                    Manufacturing and R&DAutomotive IndustryHealthcareEducation and Academic ResearchArchitects and DesignersFilm IndustryCritical Infrastructure

                    3D Printing Stories

                    • How 3D printing started: About Rep-rap and open-source with Adrian Bowyer
                    • Teaching mathematics redefined with 3D printing at JKU Linz
                    • The story behind the LTT screwdriver
                    • Victoria Hand Project: Changing Prosthetic Care with 3D Printing
                    Official Prusa Resellers
                    Sustainability
                    Prusa Education
                    Contact and Inquiry
                    Custom 3D Printing
                    ISO Certified
                  • Software▾
                    PrusaSlicer

                    PrusaSlicerPrusaSlicer

                    PrusaSlicer is an open-source, feature-rich, frequently updated tool that contains everything you need to export the perfect print files for your 3D printer.

                    WindowsMacOSLinux
                    Prusa Connect

                    Prusa Connect

                    Prusa Connect is a cloud service enabling remote control and monitoring of your 3D printers, offering secure data handling, easy setup, and support for managing multiple printers from anywhere.

                    Log in to Connect
                    Prusa.app

                    Prusa.app

                    Control your printer/s remotely from anywhere using the Prusa Connect technology behind. Prusa.app brings a new level of Prusa printer experience to Android and iOS phones.

                    Try it now!
                    Drivers & FirmwareDownload the latest firmware and drivers for your 3D printer.
                    PrusaSlicer Support
                    Prusa Connect Support
                  • 3D Models▾
                    3D PrintersArt & DesignHobby & MakersHouseholdTabletop MiniaturesToys & GamesPrintables Store

                    Popular 3D models

                    • Strong garden hose holder
                    • Prusa Spool Bot
                    • Build Tray — Modular Organizer for Assembly, Disassembly and Maintenance
                    • Broom Holder
                    • Octagon Fabric
                    • Prusa CORE One ? (Mimic Skin)

                    Design Contests

                    • Framework Laptop 12 Mainboard Re-Use9/1/2026 – 9/30/2026
                    • 🏆 Designer Challenge: Magic tricks!9/1/2026 – 9/22/2026
                    • Prototype to Product: Camera Accessories8/1/2026 – 9/14/2026
                  • Community▾

                    Upcoming Events

                    • Maker Faire Tokyo 20269/5/2026 – 9/6/2026 · Tokyo, Japan · Prusa Team
                    • IFA 20269/4/2026 – 9/8/2026 · Berlin, Germany · Prusa Team
                    • 3D Printopia 20269/26/2026 – 9/27/2026 · Pennsylvania, United States · Prusa Team
                    • Maker Faire Bay Area9/25/2026 – 9/27/2026 · Kalifornie, United States · Prusa Team

                    Prusa Forum

                    • Footprint needed for Core One + Gen2 INDX 8
                    • Bed overcurrent
                    • Printable parts for Core One + INDX?
                    Prusa World MapPrusa World MapFind local 3D printing users and explore the community around you.
                  • Help▾
                    Guides & TutorialsPrusaSlicerPrusa ConnectMaterials

                    Printer Model

                    CORE One INDXCORE One LCORE One+CORE One

                    Hardware Troubleshooting

                    • Selftest failed (CORE One/+)
                    • Clogged nozzle (CORE One, CORE One L, XL, MK4/S, MK3.9/S)
                    • Adjusting belt tension (CORE One/+, CORE One INDX, CORE One L/+)
                    • Prusa Connect and PrusaLink explained

                    Drivers & Firmware

                    INDX familyCORE One familyMK4 familyXL familyMMU familyPRO family
                  • Courses▾

                    Become an expert in 3D printing

                    Prusa Academy offers online courses on various 3D printing related topics. Each course features:

                    • easy-to-read text with many pictures and short videos
                    • links for inspiration and further study
                    • quizzes for testing your knowledge along the way
                    • certificate of completion
                    Browse all coursesMy courses library
                    • 3D Modeling in Autodesk Fusion
                    • PrusaSlicer Masterclass – Beginner to Advanced
                    • Complete Guide to 3D Print Postprocessing, Painting, and Detailing
                    • Airbrush Your 3D Prints: From Basics to Advanced Tricks
                  • Blog▾
                    • Back-to-School 2026 Deals Are Here!
                    • PrusaSlicer 3.0 Preview – Built for the Future of 3D Printing
                    • Prusa CORE One+ (Gen 2) INDX, Shipping Has Started, Complete Printers Open for Orders
                    E-Book: Basics of 3D Printing
                  • Company▾

                    About Prusa Research

                    We are the largest maker of 3D printers in Europe and the United States.

                    Founded as a one-man startup in 2012 by Josef Prusa, a Czech hobbyist, maker, and inventor. In just 15 years, we've grown into a company of more than 1,200 people. Every month, we design, build, and ship over 10,000 innovative and secure 3D printers from our headquarters in Prague, Czech Republic, and Delaware, USA, to users in more than 160 countries.

                    Watch a video and find out how Prusa Research was born and what we achieved within only 10 years!

                    About UsTimelineSustainabilityOpen-source
                    About Us
                    Contact Us
                    Logo and Photos
                    ISO Certified
                  1. Support
                  2. Advanced features
                  3. Post-processing scripts
                   

                  Contents

                  • Script setup
                  • Script execution
                  • Script Parameters
                  • Examples
                  • Historical changes and breaking backward compatibility

                  Blog

                  • Back-to-School 2026 Deals Are Here!
                  • PrusaSlicer 3.0 Preview – Built for the Future of 3D Printing
                  • Prusa CORE One+ (Gen 2) INDX, Shipping Has Started, Complete Printers Open for Orders

                  Newsletter

                  Signup and get our monthly squeeze on updates, blog, printables and much more.

                  By clicking, you agree to receive our newsletter.

                  This site is protected by reCAPTCHA Enterprise and the Google Privacy Policy and Terms of Service apply.

                  Strong garden hose holder
                  E-shop
                  • 3D Printers
                  • Printer Upgrades
                  • Filaments
                  • Accessories
                  • Prusa Merchandise

                  © Prusa Research a.s.

                  Printables
                  • 3D Models
                  • Store
                  • Clubs
                  • 3D Design Contests
                  • Brands
                  Community
                  • World Map
                  • Forum
                  • User Groups
                  • Events
                  Help
                  • Prusa Help
                  • Prusa Academy
                  • 3D Printing Calculators
                  Software
                  • PrusaSlicer
                  • Prusa.app
                  • Prusa Connect
                  • Drivers and Software
                  Company
                  • About Us
                  • Blog
                  • Official Prusa Resellers
                  • Contact Us
                  • Certified for ISO 9001, ISO 14001, ISO 45001
                  • General Terms and Conditions
                  • General Terms and Conditions of Use of the PRUSA Websites
                  • Privacy Policy
                  • Information about cookies
                  • Customer Complaints Policy
                  • Status Page
                  • Do Not Sell or Share My Personal Information
                  • Supplemental Statements
                  • General Terms and Conditions
                  • General Terms and Conditions of Use of the PRUSA Websites
                  • Privacy Policy
                  • Information about cookies
                  • Customer Complaints Policy
                  • Status Page
                  • Do Not Sell or Share My Personal Information
                  • Supplemental Statements

                  © Prusa Research a.s.

                  JOSEF PRUSA®, PRUSA RESEARCH®, PRUSA POLYMERS®, PRUSA ORANGE®, PRUSA 3D ® AND PRUSAMENT® are registered trademarks of Prusa Development a.s. used by Prusa Research a.s. under licence from Prusa Development a.s.

                  Post-processing scripts

                  Relevant for

                  PrusaSlicer
                  1 comment
                  Article is also available in following languages
                  English
                  Čeština
                  Polski
                  Deutsch
                  Français
                  Español
                  Italiano
                  日本語

                  There are some things that PrusaSlicer simply doesn’t do. However, using post-processing scripts you can automatically modify the generated G-code to do (almost) anything you want.

                  You can specify the path to the script in Print settings - Output options - Post-processing scripts.

                  Script setup

                  Post-processing scripts can be written in any programming language (Perl, Python, Ruby, Bash etc.). They just need to be recognized by your system as an executable and accept the path to the G-code file as the only argument.

                  If you want to run several scripts, put each script invocation into its own line.

                  Script execution

                  Each script will be passed the absolute path of a temporary G-code file that PrusaSlicer generates. This file is stored in a temporary folder on your drive (typically your fast system drive). The script is then executed to modify the G-code in place and the resulting G-code file is written to your selected target folder or sent to a print host, such as PrusaConnect or Octoprint.

                  Please note that the G-code viewer still visualizes G-code before post-processing.
                  PrusaSlicer automatically converts all environment variables used in post-processing scripts to uppercase. To ensure compatibility, always reference them using fully capitalized names, such as "SLIC3R_FILL_DENSITY".
                   
                  Two additional environment variables are passed to post processing scripts: The environment variable SLIC3R_PP_HOST provides the host specification, where "File" means copying the G-code to a local hard drive or removable media, while the other values ("PrusaLink", "Repetier", "SL1Host", "OctoPrint", "FlashAir", "Duet", "AstroBox" ...) specify the print host type the G-code will be sent to.
                   
                  The environment variable SLIC3R_PP_OUTPUT_NAME contains the name of the G-code file including path (for SLIC3R_PP_HOST == "File") or a name that will be given to the file after it is uploaded to the host (PrusaLink, Octoprint ...)
                   
                  The post-processing script may suggest a new output file name (likely based on SLIC3R_PP_OUTPUT_NAME) by saving it as a single line into a new "output name" temp file, for example to add time stamps or sequence numbers to the final G-codes.The "output name" file name is to be created by suffixing the input G-code file name with ".output_name". PrusaSlicer will read the new name of the file and handle it properly, for example, when sending it to Octoprint.
                   

                  Script Parameters

                  You can use parameters with your script as such:

                  /path/to/executable becomes /path/to/executable with the arg outputfilename.gcode

                  /path/to/executable -arg -arg2 becomes /path/to/executable with args -arg, -arg2, and outputfilename.gcode

                  If path to executable or arguments contain spaces, these arguments need to be escaped using the escaping style common to the platform (shell escaping style on Linux and OSX, Windows command line escaping).

                  Examples

                  Python

                  Adding counter to the file name example

                  Path to the final exported file (or its name for Octoprint)

                  Python script that modifies the output path

                   

                  Historical changes and breaking backward compatibility

                  Before version 2.4, PrusaSlicer used to execute the script on the final G-code exported to your desired target medium. Which was very often a removable drive, such as an SD card. SD cards are slow and wear out, so this was not ideal. There were also problems when sending the G-code to Octoprint. The new approach with the temporary file on your system drive prevents these problems and extends the functionality of post-processing scripts. However, it might break some of your existing scripts.

                   

                  This documentation page includes some texts from the original Slic3r documentation and from Bob's Project Notebook.

                  Was this article helpful?
                  This action is available only to registered users. Please log-in.

                  1 comment

                  Log in  to post a comment
                  aczekajski
                  •
                  TLDR:
                  Your program must read the gcode from file passed as last arg and write results to the same file.

                  Each line of the "Post-processing scripts" will be run as a terminal command with the gcode filepath added at the end (as a last arg):
                  "node foo.js --bar" will be run as "node foo.js --bar /path/to/the/input.gcode".
                  Reply

                  Topics

                  • PrusaSlicer 2.9 (Legacy)
                    • Advanced features
                      • Per model settings
                      • Color change
                      • Modifiers
                      • Reload from disk
                      • Insert pause or custom G-code at layer
                      • Negative volume
                      • Simplify mesh
                      • Post-processing scripts
                      • Shape Gallery
                      • Compare presets
                      • G-code substitutions
                      • Text tool
                      • SVG embossing tool
                      • Pressure Advance
                    • About PrusaSlicer
                    • Configuration and profiles
                    • User interface
                    • Input/output
                    • Left toolbar
                    • Top toolbar
                    • Print settings
                    • Filament settings
                    • Printer settings
                    • Multi-material slicing
                    • SLA slicing
                    • Other (PrusaSlicer)