// create validate object
var req = new Validate()
{
// document
Document = new Document()
{
DocData = File.ReadAllBytes(@"myPdf.pdf"),
Name = "myPdf.pdf",
},
//action
ValidateAction = new ValidateAction()
{
PdfConformance = ValidateActionPdfConformance.PdfA2u
},
};
// validating Pdf
var res = Pdf4me.Instance.PdfAClient.ValidateAsync(req).GetAwaiter().GetResult();
//saving validation info to a json file
File.WriteAllText("validate_result.json", JsonConvert.SerializeObject(res));
// create pdf4meClient
const pdf4meClient = pdf4me.createClient('YOUR API KEY')
// create validate object
const validateReq = {
// document
document: {
docData: fs.readFileSync(path.join(__dirname, 'myPdf.pdf')).toString('base64'),
},
// action
validateAction: {
pdfConformance: 'pdfA2u',
},
}
// validate
pdf4meClient.validate(validateReq)
.then(function(validateRes) {
// and writing it to disk as json
fs.writeFileSync(path.join(__dirname, 'validate_result.json'), JSON.stringify(validateRes, null, 2))
})
.catch(error => {
console.log(error)
})
# setup the pdfA_client
pdfA_client = PdfAClient(pdf4me_client)
# create the create_pdfA object
validate = Validate(
document=Document(
name = 'myPdf.pdf',
doc_data=FileReader().get_file_data('myPdf.pdf')
),
validate_action=ValidateAction(
pdf_conformance='pdfA2u'
)
)
# validated to PDF/A
validated = pdfA_client.validate(validate=validate)
# extracting the pdfvalidation
print(validated)
ValidateDocument
curl
C#
Java
JavaScript
PHP
Python
Ruby
curl No Sample
// validating
var res = Pdf4me.Instance.PdfAClient.ValidateDocumentAsync(File.ReadAllBytes("myPdf.pdf"),PdfAActionCompliance.PdfA1b).GetAwaiter().GetResult();
//saving validate info to a json file
File.WriteAllText("validate_result.json", JsonConvert.SerializeObject(res));
// create pdf4meClient
const pdf4meClient = pdf4me.createClient('YOUR API KEY')
// validate
pdf4meClient.validateDocument('pdfA1b', fs.createReadStream(path.join(__dirname, 'myPdf.pdf')))
.then(function(validateRes) {
// and writing it to disk as json
fs.writeFileSync(path.join(__dirname, 'validate_result.json'), JSON.stringify(validateRes, null, 2))
})
.catch(error => {
console.error(error)
})
Logging information about the request, e.g. timestamp.
Page
Name
Type
Description
Notes
documentId
String
Globally unique Id.
pageId
String
Globally unique Id.
pageNumber
Integer
PageNumber, starting with 1.
rotate
double
By how much the page was rotated from its original orientation.
thumbnail
byte
Thumbnail representing this particular page.
sourceDocumentId
String
Id of the document it was created from, e.g. in case of an extraction, the result's sourceDocumentId is the Id of the PDF the pages have been extracted from.
sourcePageNumber
Integer
Page number of the original page in the original document, e.g. let's assume document B consists of page number 4 of document A (extraction). Thus, document B's only page's sourcePageNumber is number 4.