Convert PDF to BMP via Rust

PDF to BMP conversion in Rust language. Programmers can use API example code for batch PDF files to BMP.

Convert PDF to BMP in Aspose.PDF for Rust via C++

In order to convert PDF to BMP, we’ll use Aspose.PDF API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C++ platform. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console.

How to Convert PDF to BMP


Rust developers can easily load & convert PDF files to BMP in just a few lines of code.

  1. Open a PDF document for converting
  2. Convert a PDF Page to BMP using page_to_bmp function
  3. Close the PDF document and release any allocated resources

Here is an example that demonstrates how to convert PDF to BMP in Rust. You can follow these easy steps to convert your PDF file to BMP format. First, upload your PDF file and then simply save it as a BMP file. You can use fully qualified filenames for both PDF reading and BMP writing. The output BMP content and formatting will be identical to the original PDF document.

Example: Convert PDF to BMP via Rust

This sample code shows PDF to BMP Rust Conversion

Input file:

File not added

Output format:

BMP

Output file:


use asposepdf::Document;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Open a PDF-document with filename
    let pdf = Document::open("sample.pdf")?;

    // Convert and save the specified page as Bmp-image
    pdf.page_to_bmp(1, 100, "sample_page1.bmp")?;

    Ok(())
}

Convert PDF to BMP using Aspose.PDF for Rust via C++

Our .NET Library can convert a document from any supported download format to any supported save format. Aspose.PDF for .NET library provides fairly universal solutions that will help you solve the tasks of converting documents. Aspose.PDF supports the largest number of popular document formats, both for loading and saving. Draw your attention that the current section describes only popular conversions. The current page provides information about converting PDF to BMP. However, there are many combinations for converting your files. For a complete list of supported formats, see the section Supported File Formats.