PDF to HTML API - Dart/Flutter Client
PDF to HTML converts the pages of a PDF, uploaded or fetched from a URL, into one self-contained HTML file that looks like the original: same layout, embedded fonts and images, and real selectable text. Choose a page range, unlock password-protected PDFs, or ask for text only; long documents are converted in batches, with nextPage pointing to the next one.
This is the Dart/Flutter client for the PDF to HTML API.
Installation
Add this to your pubspec.yaml:
dependencies:
apiverve_pdftohtml: ^1.2.6
Then run:
dart pub get
# or for Flutter
flutter pub get
Usage
import 'package:apiverve_pdftohtml/apiverve_pdftohtml.dart';
void main() async {
final client = PdftohtmlClient('YOUR_API_KEY');
try {
// This API requires a file upload — a JSON body is rejected with a 400.
final response = await client.executeWithFile('/path/to/your-file');
print('Status: ${response.status}');
print('Data: ${response.data}');
} catch (e) {
print('Error: $e');
}
}
Response
{
"status": "ok",
"error": null,
"data": {
"htmlName": "7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.html",
"pageCount": 14,
"firstPage": 1,
"lastPage": 10,
"pagesConverted": 10,
"nextPage": 11,
"textOnly": false,
"encrypted": false,
"size": 1873402,
"inline": false,
"html": null,
"expires": 1792400000000,
"downloadURL": "https://storage.googleapis.com/apiverve/APIData/pdftohtml/7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.html?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792400000&Signature=SAMPLE"
}
}
API Reference
- API Home: PDF to HTML API
- Documentation: docs.apiverve.com/ref/pdftohtml
Authentication
All requests require an API key. Get yours at apiverve.com.
License
MIT License - see LICENSE for details.
Built with Dart for APIVerve
Libraries
- apiverve_pdftohtml
- PDF to HTML API client for Dart/Flutter