PUB Command Line Converter | Aspose.PUB CLI Tools
Overview
Aspose.PUB Convert is a powerful command-line tool that lets you easily convert Microsoft Publisher files (PUB) into formats everyone can use. This is a game-changer for developers and designers who need to make sure their documents work on any device.
Key Features
- Supported Input Formats: PUB.
- Supported Output Formats: PDF, JPEG, PNG, BMP, TIFF, GIF, DOC, DOCX, XLS, XLSX, CSV, PPTX, XPS, EPUB, TEX, MHTML, HTML, SVG.
- Flexible Usage: Can be used both via simple command-line commands and programmatically in your C# code, compatible with .NET 6.0/7.0.
Benefits
Using the Aspose.PUB Convert tool provides several advantages:
- Efficiency: Quickly convert documents between multiple formats without the need for complex software.
- Automation: Integrate document conversion into your automated workflows and scripts.
- Flexibility: Handle various document formats to ensure compatibility with different systems and applications.
Licensing
While the Aspose.PUB Convert application itself is free to use, converting documents requires a valid Aspose.PUB license. You can purchase a license or use Aspose.PUB in trial mode for evaluation purposes.
How to install PUB Command-Line Converter?
The Aspose.PUB Convert tool can be installed either globally or locally, depending on your project’s needs. It is recommended to use the local installation for project-specific use to avoid version conflicts.
Global Installation
To install Aspose.PUB Convert globally on your machine, use the following command:
1dotnet tool install --global Aspose.PUB.Convert
Specify the --version
option if you need a specific version of the tool.
Local Installation
For local installation within a specific project, first, navigate to your project’s root directory. Then, execute the following commands:
- Create a tool-manifest if not already present:
1dotnet new tool-manifest
- Install Aspose.PUB Convert locally:
1dotnet tool install Aspose.PUB.Convert --local
Again, you can specify the --version
option for a specific version.
Updating the PUB CLI Converter
To update the Aspose.PUB Convert tool to the latest version, use the dotnet tool update
command with either --global
or --local
, matching your installation type.
Uninstalling the Publisher CLI Converter
If you need to uninstall the tool, use the dotnet tool uninstall
command with either --global
or --local
, depending on how the tool was installed.
Usage
Command Line
Convert your documents using command-line arguments. Here are the available parameters:
-i, --input [Required]
: Path to the input PUB document.- Example:
--input input.pub
- Example:
-o, --output [Required]
: Path for the converted document.- Example:
--output output.pdf
- Example:
-f, --format [Optional]
: Output document format.- Supported formats: PDF, JPG, PNG, BMP, TIFF, GIF, DOC, DOCX, XLS, XLSX, CSV, PPTX, XPS, EPUB, TEX, MHTML, HTML, SVG.
- Example:
--format pdf
-l, --license [Optional]
: Path to the Aspose.PUB .NET license file.- Example:
--license path_to_license.lic
- Example:
-v, --verbose [Optional]
: Enable verbose output.- Example:
--verbose
- Example:
Example command-line usage:
1Aspose.PUB.Convert --input input.pub --output output.pdf --format pdf
How to integrate CLI PUB Converter into C# Projects?
The Aspose.PUB Convert application can also be integrated directly into your .NET projects using the command line, enabling programmatic access to document conversion capabilities within your C# code.
Adding the Command Line Converter to Your Project:
To add the Aspose.PUB Convert tool to your Visual Studio project, navigate to your project’s root directory, and execute the following command:
1dotnet Aspose.PUB.Convert add
This command adds the Aspose.PUB Convert functionality directly into your project, allowing you to use the library’s methods and properties through your code. This is particularly useful for developers looking to implement customized document conversion processes directly within their applications.
Use from Code
Here is an example of using the Aspose.PUB CLI tools programmatically in your C# code:
1using Aspose.Pub.MicroApps.Convert;
2using System.Threading.Tasks;
3
4class Program
5{
6 static async Task Main(string[] args)
7 {
8 // Initialize convert options
9 var options = new ConvertOptions
10 {
11 // Required: Specify the input document path
12 InputPath = "input.pub",
13
14 // Required: Specify the output document path
15 OutputPath = "output.pdf",
16
17 // Optional: Specify the output format
18 ToFormat = "pdf"
19 };
20
21 // Execute the conversion task
22 await ConvertTasks.Create(options).Execute();
23 }
24}
For more information and usage examples, please visit the Aspose.PUB for .NET documentation.