| title | NetPDF PowerShell module of .NET suite for PDFBox™ |
|---|---|
| _description | Describes the PowerShell module to use PDFBox™ classes from any PowerShell shell |
To install the tool executes the following command within a PowerShell shell:
Install-Module -Name MASES.NetPDFPSIf the above command fails, reporting errors related to authenticode, use the following command:
Install-Module -Name MASES.NetPDFPS -SkipPublisherCheckTo use the PowerShell interface (NetPDFPS) runs the following commands within a PowerShell shell:
- The following cmdlet initialize the environment:
Start-NetPDFPS [arguments]Now everything is ready and you can create objects like in the following snippet:
$var = Open-PDF -PdfFile <path-to-PDF-file-open>
$pages = $var.NumberOfPages
$var.RemovePage(0)
Save-PDF -PdfDocument $var -OutputFile <path-to-PDF-file-to-save>netpdfps accepts the following cmdlets:
- Start-NetPDFPS: Initialize the engine and shall be the first command to be invoked. The arguments are:
- LicensePath
- JDKHome
- JVMPath
- JNIVerbosity
- JNIOutputFile
- JmxPort
- EnableDebug
- JavaDebugPort
- DebugSuspendFlag
- JavaDebugOpts
- HeapSize
- InitialHeapSize
- LogClassPath
- Open-PDF: open a PDF file. The arguments are:
- PdfFile
- Save-PDF: Save a previously opened PDF file. The arguments are:
- PdfDocument
- OutputFile
- CompressParameter (optional)
One of the most important command-line switch is JVMPath: it can be used to set-up the location of the JVM™ library (jvm.dll/libjvm.so) if JCOBridge is not able to identify a suitable JRE installation.