Automatically integrate CS-Scripts with PDF conversion

Categories:

If you’ve ever wished you could make PDFCreator do just a little more, then the CS-Script action might be exactly what you’ve been looking for. It can rename files automatically, send documents straight to another application, or validate metadata before saving. 

This advanced PDFCreator feature, available exclusively in our Business editions, lets you insert small C# scripts into your conversion process. This allows you to fully customize what happens before or after a PDF document is created. Make your daily print and conversion work faster and more efficient. 

What is the CS-Script?

Another way to think of the CS-Script action is as a bridge between PDFCreator and your own business logic. Instead of manually running extra steps after conversion, you can automate them directly inside your workflow. 

You decide when your script runs: 

  • Before conversion: to check file properties or adjust metadata 
  • After conversion: to rename, move, or upload the finished PDF document 
C sharp code connecting to a PDFCreator interface that produces a secured PDF document

Automating secure PDF generation with C# to streamline document workflows

When to use it

Here are a few ways businesses use the CS-Script action every day: 

  • Quality checks: Cancel or tag print jobs that don’t meet naming rules or metadata standards.
  • Automatic uploads: Push completed PDFs to a DMS, cloud folder, or internal API.
  • Custom logging: Keep detailed conversion records for audits or billing.
  • Post-processing: Apply compression, password protection, or further editing tools automatically.

Essentially, if you’ve ever thought “I wish PDFCreator could do X when a job finishes”, you can probably achieve it with CS-Script. 

How CS-Script works

Once you enable the action in the profile settings, PDFCreator looks for your script file (usually in the “CS-Scripts” folder). 
When a job starts, PDFCreator: 

  1. Loads and compiles your script. 
  2. Hands it the current print job’s details. 
  3. Executes your pre- and post-conversion methods. 

You can then access properties like filenames, output paths, tokens, and metadata, allowing your code to modify, validate, or trigger additional steps. 

Ready to take document workflow automation to the next level?
Try PDF Creator’s CS-Script feature today streamline your workflow in one click.

Try PDFCreator for 30 days

Use case

Here’s a minimal template showing how a script might look: 

using System; 
using NLog; 
using pdfforge.CustomScriptAction; 
using pdfforge.PDFCreator.Conversion.Jobs.Jobs; 
 
public class MyScript : IPDFCreatorScript 

    public ScriptResult PreConversion(Job job, Logger logger) 
    { 
        job.JobInfo.Metadata.Author = "Marketing"; 
        return ScriptResult.Success; 
    } 
 
    public ScriptResult PostConversion(Job job, Logger logger) 
    { 
        logger.Info("Files created: " + string.Join(Environment.NewLine, job.OutputFiles)); 
        return ScriptResult.Success; 
    } 

In this example, the script adds a default author before conversion and logs the output path afterward. 

Why you should use C# to convert PDFs

The CS-Script action is one of PDFCreator’s most flexible tools. It saves hours of manual post-processing, integrates easily into existing systems, and scales perfectly for automated workflows. 

If you’re using one of PDFCreator’s Business editions, we strongly suggest you give it a try. Open your profile settings, enable CS-Script, and see how much smarter your PDF workflows can become. 

How to integrate your CS-Scripts before and after a PDF conversion

The CS-Script action can be enabled in the advanced section of the queue settings. Your script file must be located in the CS-Scripts folder and has to be a .cs or .csx file. To automatically integrate them as part of the workflow (action) feature in PDFCreator, here is what you need to do: 

  1. Open PDFCreator 
  2. Go to the "Profiles" tab to select the "Automatic saving mode" 
  3. Click on “Add action” and select “CS-Script” 
  4. Select and check your CS-Script and click on “OK” 

Now your CS-Scripts will automatically be integrated in the workflow when converting your print jobs.  

Frequently asked questions about CS-Script

Check the sample script included with PDFCreator and visit the official user guide.

  • Rename or move PDFs after conversion. 
  • Log job details or validate files before saving. 
  • Automate repetitive post-processing steps. 

Place your .cs or .csx file in the CS-Scripts folder. Once selected and enabled in the PDFCreator’s CS-Script action, the script automatically runs during each print job to modify or enhance your PDF worklfow.

C# (C-Sharp). CS-Script runs standard C# code inside PDFCreator, using the .NET Framework.

A normal job simply converts your document. With CS-Script, PDFCreator executes custom code before and/or after the conversion, letting you adjust settings, add actions, or automate tasks.

Store all your scripts in the default CS-Scripts folder. Name them clearly (e.g., RenameFile_PreConversion.cs) so they’re easy to identify and maintain.

You can automate and customize every job, add advanced logic to conversions, and integrate PDFCreator with other systems, all from one application.

You can also insert custom data fields or personalize files automatically.

Other articles you might enjoy

Document workflow automation: Transform your business operations

How to print to PDF with PDFCreator:
A step-by-step guide