Hi Carl

 

thanks for your feedback, I was able to integrate veraPDF now.

And it led me to my next problem/question.

 

The PDF files, I have to validate, are embedded in a XML document as a Base64 encoded text.

A requirement to  my software is, that no files shall be written or read, due to security and performance reasons.

 

With the actual pdf-validation software it’s possible to pass the pdf as a byte[].

I tried some similar with veraPDF, like this:

Foundries.defaultInstance().createParser(new ByteArrayInputStream(pdfStrB64.getBytes()),flavour))

 

This ends up with the following exceptions:

 

Executing CDA validation...org.verapdf.core.ModelParsingException: Couldn't parse stream

       at org.verapdf.gf.model.GFModelParser.createModelWithFlavour(GFModelParser.java:97)

       at org.verapdf.pdfa.VeraFoundry.createParser(VeraFoundry.java:71)

…….

Caused by: java.io.IOException: PDFParser::GetXRefInfo(...)startxref validation failed

       at org.verapdf.parser.PDFParser.getXRefInfo(PDFParser.java:494)

       at org.verapdf.parser.PDFParser.getXRefInfo(PDFParser.java:219)

       at org.verapdf.io.Reader.init(Reader.java:143)

       at org.verapdf.io.Reader.<init>(Reader.java:66)

       at org.verapdf.cos.COSDocument.initReader(COSDocument.java:119)

       at org.verapdf.cos.COSDocument.<init>(COSDocument.java:98)

       at org.verapdf.pd.PDDocument.<init>(PDDocument.java:65)

       at org.verapdf.gf.model.GFModelParser.<init>(GFModelParser.java:70)

       at org.verapdf.gf.model.GFModelParser.createModelWithFlavour(GFModelParser.java:93)

       ... 11 more

 

Is there another way to do the validation, the way I should do it?

 

Thanks and best regards

Adrian

 

 

From: Carl Wilson [mailto:carl@openpreservation.org]
Sent: Dienstag, 1. August 2017 18:15
To: Adrian Suter smaps GmbH; users@lists.verapdf.org
Subject: Re: [Users] Use of veraPDf

 

Hi Adrian,

 

Thanks to Jochen for getting in touch, I think that the best method is to use straightforward Maven. Checking up on the answer led me to discover that the latest 1.6 Maven artefacts weren't deployed to Maven central so I've just uploaded them, they'll be there tomorrow.

 

The simplest and quickest way would be to use the Greenfield validation-model. Once Maven has indexed my uploads this would be:

 

<dependency>
  <groupId>org.verapdf</groupId>
  <artifactId>validation-model</artifactId>
  <version>1.6.2</version>
</dependency>

If that doesn't work then the following 1.4 instructions will while Maven rights itself.

 

<dependency>
  <groupId>org.verapdf</groupId>
  <artifactId>validation-model</artifactId>
  <version>1.4.7</version>
</dependency>

The initialistion and validation code at the bottom of this page: http://docs.verapdf.org/develop/ should work now. Feel free to ask further questions.

 

Best,

Carl

 

Carl Wilson | Technical Lead

carl@openpreservation.org | skype: carl.f.wilson

Open Preservation Foundation | openpreservation.org

 

On Tue, 1 Aug 2017 at 11:08 Adrian Suter smaps GmbH <adrian.suter@smaps.ch> wrote:

Hi there

 

I’m new on using veraPDF and have some basic problems.

I want to use veraPDF in my own software and tried the following,

-        Download the veraPDF-library, mvn clean install and added the jar to my pom.xml

-        I followed the steps described on http://docs.verapdf.org/develop/

-        Tried first with Greenfield validation model and later on the PDFBox validation model

-        With both there were several jars missing (org/mozilla/javascript/Scriptable; org/verapdf/model/baselayer/Object; and so on)

 

So I’m quite sure, that I’m doing something completely wrong L

 

Can please somebody help me,

-        which projects to download exactly

-        how to configure/implement it to my code

 

Thanks a lot, best regards

Adrian Suter

smaps GmbH

Diessbachstrasse 2, 3253 Schnottwil

Mobil +41 (0)79 945 91 01

adrian.suter@smaps.ch

 

_______________________________________________
Users mailing list
Users@lists.verapdf.org
http://lists.verapdf.org/listinfo/users

--

Carl Wilson | Technical Lead

carl@openpreservation.org | skype: carl.f.wilson

Open Preservation Foundation | openpreservation.org