Official SDKs
Production-ready SDKs for Office to PDF conversion with official API clients.
Why Use Our SDKs?
Production Ready
Built for real-world use with support for large files, streaming uploads and downloads, automatic retries, and consistent error handling.
Consistent API
All SDKs follow the same API conventions and error model for a consistent developer experience across languages.
Streaming Support
Handle large files efficiently with streaming downloads and disk-based processing to avoid excessive memory usage.
Secure & Reliable
Built-in error handling, retry logic, and structured error responses make it easy to implement consistent retry and fallback logic.
Get Started
Node.js
AvailableTypeScript
TypeScript-first SDK with full type safety and excellent IDE support.
Installation:
npm install @office2pdf/nodeExample:
import { Office2PDF } from "@office2pdf/node";
import fs from "fs";
const client = new Office2PDF({
apiKey: process.env.OFFICE2PDF_API_KEY,
});
const result = await client.convert({
filePath: "./input.docx",
downloadToPath: "./output.pdf",
});
console.log("PDF saved to:", result.path);Python
Coming SoonPython
Python SDK with async support and streaming capabilities.
Example:
from office2pdf import Office2PDF
client = Office2PDF(api_key=os.getenv("OFFICE2PDF_API_KEY"))
result = client.convert(
file_path="./input.docx",
download_to_path="./output.pdf"
)
print(f"PDF saved to: {result.path}")Go
Coming SoonGo
High-performance Go SDK with zero dependencies.
Example:
package main
import (
"github.com/office2pdf/go-sdk"
"os"
)
func main() {
client := office2pdf.NewClient(os.Getenv("OFFICE2PDF_API_KEY"))
result, err := client.Convert(&office2pdf.ConvertOptions{
FilePath: "./input.docx",
DownloadToPath: "./output.pdf",
})
if err != nil {
panic(err)
}
fmt.Printf("PDF saved to: %s\n", result.Path)
}Java
Coming SoonJava / Kotlin
Java SDK compatible with Kotlin and all JVM languages.
Example:
import com.office2pdf.Office2PDF;
import java.io.File;
Office2PDF client = new Office2PDF(
System.getenv("OFFICE2PDF_API_KEY")
);
ConvertResult result = client.convert(
ConvertOptions.builder()
.filePath("./input.docx")
.downloadToPath("./output.pdf")
.build()
);
System.out.println("PDF saved to: " + result.getPath());Authentication
All requests are authenticated using an API key. The API key must be sent via the x-api-key header.
x-api-key: YOUR_API_KEYAPI keys can be created and managed from the Office2PDF dashboard.
Error Handling
All SDKs return structured errors with the same shape and semantics. Each error includes:
- A stable error code
- A human-readable message
- HTTP status (when applicable)
- A request ID for debugging and support
Example error codes include: UNAUTHORIZED, INVALID_REQUEST, RATE_LIMITED, QUOTA_EXCEEDED, SERVER_ERROR
Ready to Get Started?
Check out the GitHub repository for the latest updates, examples, and documentation.
View SDK Repository