Convert PDF to PDF/A
Convert PDF to PDF/A replacing title, author, creation date and custom properties.
/pdfa
Body parameters
This method supports only multipart/form-data
.
Parameter | Description |
---|---|
file binary, required | PDF file that you want to convert to PDF/A. |
conformanceLevel enum, required | PDF/A conformance level: PDF_A_2B , PDF_A_3B or PDF_A_2U . |
title string(255) | Replace the title of the PDF file. |
author string(255) | Replace the author of the PDF file. |
creationDate datetime | Replace the creation date of the PDF file. |
customProperties object[] | Add or replace custom properties (metadata) to the PDF file. |
customProperties[].name string(255), required | Name of the custom property. |
customProperties[].value string(255), required | Value of the custom property. |
var formData = new FormData();
formData.append('file', pdfFile);
formData.append('conformanceLevel', 'PDF_A_2B');
formData.append('title', 'My Title');
formData.append('author', 'Author name');
formData.append('creationDate', new Date());
formData.append('customProperties[0].name', 'MyProperty');
formData.append('customProperties[0].value', 'My Property Value');
axios({
method: 'post',
url: '/pdfa',
data: formData,
config: {
headers: {
'Content-Type': 'multipart/form-data'
}
}
}).then(function (response) {
// handle success
}).catch(function (response) {
// handle error
});
var bytes = File.ReadAllBytes("/path/to/file.pdf");
var pdfFile = new ByteArrayContent(bytes);
pdfFile.Headers.ContentType = new MediaTypeHeaderValue(MediaTypeNames.Application.Pdf);
var formData = new MultipartFormDataContent();
formData.Add(pdfFile, "file", "file");
formData.Add("PDF_A_2B", "conformanceLevel");
formData.Add("My Title", "title");
formData.Add("Author name", "author");
formData.Add(new DateTime().ToString("o"), "creationDate");
formData.Add("MyProperty", "customProperties[0].name");
formData.Add("My Property Value", "customProperties[0].value");
var client = new HttpClient();
var response = await _client.PostAsync("/pdfa", formData);
Responses
Status code 200 - PDF/A file (binary).
Status code 400 - Malformed request body:
{
"errors": []
}
Status code 500 - Internal API error.