Sorry, the line-breaks were "\n", not "\r".
And changing it to "\r\n" did not make any difference...

On Mon, Jun 26, 2017 at 9:55 PM, Gilad Denneboom <[email protected]>
wrote:

> Hi Frank,
>
> Thanks for your reply.
> - Windows 7
> - I didn't want to edit the xfdf files at all, as I had understood they
> should work...
> I'm seeing now that the lines end with "\r" only. I'll try to replace them
> with "\r\n".
>
> Regards, Gilad.
>
> On Mon, Jun 26, 2017 at 6:28 PM, Mehlhose, Frank (Application Business
> Services - Public Sector) <[email protected]> wrote:
>
>> Hello Gilad,
>>
>> One what operating system do you test?
>> Did you consider converting the Windows line endings in file
>> Multipage_Sample_annots_ square.xfdf to Unix format with dos2unix?
>>
>> Mit freundlichen Grüßen / With kind regards
>>
>> Frank Mehlhose
>> Application Business Services
>> Public Sector
>>
>> DXC Technology Germany
>>
>> VoIP +49 7031 4505 175
>> Mobile +49 152 0165 0812
>> [email protected]
>>
>> EntServ Deutschland GmbH
>> Schickardstraße 32
>> 71034 Böblingen
>>
>> dxc.technology / Twitter / Facebook / LinkedIn
>>
>> Geschäftsführer: Michael Eberhardt, Joachim Löffler
>> Sitz der Gesellschaft: Böblingen, Amtsgericht Stuttgart HRB 757510
>> VAT ID: DE307881136
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Gilad Denneboom [mailto:[email protected]]
>> Gesendet: Montag, 26. Juni 2017 14:25
>> An: [email protected]
>> Betreff: Re: Adding a Redaction annotation (without applying it)
>>
>> Wow, that's really strange... Anyone from the PDFBox team have any idea
>> what might be causing this issue?
>>
>> On Mon, Jun 26, 2017 at 1:23 PM, Stoll, Matthias <[email protected]>
>> wrote:
>>
>> > Hi Gilad,
>> >
>> > I have never seen the issues that you see. In tests so far I have used:
>> > pdfbox-app-1.8.10.jar (with this version there were XFDF restrictions,
>> > i.e. missing coloring) pdfbox-app-2.0.0-RC2.jar (this was an
>> > intermediate version we received from the developers)
>> >
>> > To be honest - I have no idea what is different when you run the code
>> > than when I do.
>> >
>> > I just downloaded and tested it with pdfbox-app-2.0.6.jar - no
>> > problems at all.
>> >
>> > Kind regards,
>> >  Matthias
>> >
>> > -----Original Message-----
>> > From: Gilad Denneboom [mailto:[email protected]]
>> > Sent: Freitag, 23. Juni 2017 15:58
>> > To: [email protected]
>> > Subject: Re: Adding a Redaction annotation (without applying it)
>> >
>> > Thanks for the files, but it's still not working for me... What *exact
>> > *version of PDFBox are you using?
>> >
>> > On Fri, Jun 23, 2017 at 2:19 PM, Stoll, Matthias
>> > <[email protected]>
>> > wrote:
>> >
>> > > Hi Gilad,
>> > >
>> > > I have run the code again with a former 2.0 release candidate of
>> PDFBox.
>> > > The sample code and the sample PDF along with an XFDF can be
>> > > downloaded from here:
>> > > http://www.stolli.de/downloads/xfdf/gilad.zip
>> > >
>> > > You simply compile the class and run it with 3 arguments (the first
>> > > 2 files are part of the ZIP, the third one generates the PDF with
>> > > the stamped XFDF in it)
>> > >
>> > > Multipage_Sample_PDFA.pdf
>> > > Multipage_Sample_annots_freetext.xfdf
>> > > testoutput.pdf
>> > >
>> > > The code runs with any PDFBox version, but the very old 1.8.10
>> > > version I used to use when I filed the JIRA did not print the text
>> > > in correct color (and had other XFDF errors). The more recent PDFBox
>> > > versions all
>> > do the job.
>> > >
>> > > Please let me know how it works.
>> > >
>> > > Cheers,
>> > >  Matthias
>> > >
>> > > -----Original Message-----
>> > > From: Gilad Denneboom [mailto:[email protected]]
>> > > Sent: Freitag, 23. Juni 2017 09:59
>> > > To: [email protected]
>> > > Subject: Re: Adding a Redaction annotation (without applying it)
>> > >
>> > > Do you remember what version you used at the time? Because I tried
>> > > it with 2.0.6, 2.0.0 and 1.8.13 and the results were pretty much the
>> > > same in all of them.
>> > >
>> > > On Fri, Jun 23, 2017 at 9:15 AM, Stoll, Matthias
>> > > <[email protected]>
>> > > wrote:
>> > >
>> > > > Hi Gilad.
>> > > >
>> > > > I will try to have a look into it by begin of next week as my time
>> > > > is limited this week due to open business projects.
>> > > > The sample code worked when I opened the issue. Will check with
>> > > > most recent PDFBox - and see what our developers say regarding our
>> > > > production code.
>> > > >
>> > > > I will come back to you.
>> > > >
>> > > > Kind regards,
>> > > >  Matthias
>> > > >
>> > > > -----Original Message-----
>> > > > From: Gilad Denneboom [mailto:[email protected]]
>> > > > Sent: Donnerstag, 22. Juni 2017 17:41
>> > > > To: [email protected]
>> > > > Subject: Re: Adding a Redaction annotation (without applying it)
>> > > >
>> > > > No, it's not working, either. Tried loading
>> > > > Multipage_Sample_annots_ square.xfdf and got this:
>> > > >
>> > > > Exception in thread "main" java.io.IOException: Error:
>> > > > End-of-File, expected line
>> > > >     at org.apache.pdfbox.pdfparser.BaseParser.readLine(
>> > > > BaseParser.java:1145)
>> > > >     at org.apache.pdfbox.pdfparser.COSParser.parseHeader(
>> > > > COSParser.java:1995)
>> > > >     at org.apache.pdfbox.pdfparser.COSParser.parseFDFHeader(
>> > > > COSParser.java:1977)
>> > > >     at org.apache.pdfbox.pdfparser.FDFParser.parse(FDFParser.java:1
>> 58)
>> > > >     at org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.
>> > > > java:184)
>> > > >     at RedactClip.main(RedactClip.java:17)
>> > > >
>> > > >
>> > > > On Thu, Jun 22, 2017 at 5:33 PM, Stoll, Matthias
>> > > > <[email protected]>
>> > > > wrote:
>> > > >
>> > > > > I would recommend to start with the sample XFDF as provided with
>> > > > > my initial JIRA issue.
>> > > > > This is only to ensure that PDFBox reads the correct XML
>> > > > > metadata it might need to process.
>> > > > > Does this work for you with the current PDFBox version?
>> > > > >
>> > > > > -----Original Message-----
>> > > > > From: Gilad Denneboom [mailto:[email protected]]
>> > > > > Sent: Donnerstag, 22. Juni 2017 17:13
>> > > > > To: [email protected]
>> > > > > Subject: Re: Adding a Redaction annotation (without applying it)
>> > > > >
>> > > > > I tried the same with an FDF file. This time it was read
>> > > > > successfully, but the annotations were not added:
>> > > > >
>> > > > > Jun 22, 2017 5:08:46 PM
>> > > > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotation
>> > > > > create
>> > > > > WARNING: Unknown or unsupported annotation type 'Redact'
>> > > > > Jun 22, 2017 5:08:46 PM
>> > > > > org.apache.pdfbox.pdmodel.fdf.FDFAnnotation
>> > > > > create
>> > > > > WARNING: Unknown or unsupported annotation type 'Popup'
>> > > > >
>> > > > > On Thu, Jun 22, 2017 at 4:51 PM, Gilad Denneboom <
>> > > > > [email protected]>
>> > > > > wrote:
>> > > > >
>> > > > > > I've encountered my first stumble-block... When I try to
>> > > > > > import my Acrobat-generated XFDF file I get this exception:
>> > > > > >
>> > > > > > Exception in thread "main" java.io.IOException: Error: Header
>> > > > > > doesn't contain versioninfo
>> > > > > >     at org.apache.pdfbox.pdfparser.FDFParser.parse(FDFParser.
>> > > java:160)
>> > > > > >     at
>> > > > > > org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.j
>> > > > > > ava:184)
>> > > > > >     at RedactClip.main(RedactClip.java:15)
>> > > > > >
>> > > > > > Any ideas?
>> > > > > >
>> > > > > > PS. I'm using PDFBox 2.0.6
>> > > > > >
>> > > > > >
>> > > > > > On Thu, Jun 22, 2017 at 3:02 PM, Gilad Denneboom <
>> > > > > > [email protected]> wrote:
>> > > > > >
>> > > > > >> Certainly! I'll give it a try and will post any updates here...
>> > > > > >> Thanks for your help so far.
>> > > > > >>
>> > > > > >> On Thu, Jun 22, 2017 at 2:39 PM, Stoll, Matthias
>> > > > > >> <[email protected]>
>> > > > > >> wrote:
>> > > > > >>
>> > > > > >>> Hi Gilad,
>> > > > > >>>
>> > > > > >>> Exactly - and there is a small code sample already from
>> > > > > >>> which you can start (XFDFStamper.java)
>> > > > > >>>
>> > > > > >>> PDFBox team has improved their support of XFDF after that
>> > > > > >>> call and we will try to contribute a bit in the future as
>> > > > > >>> there are still some smaller issues/ restrictions. But we
>> > > > > >>> can already use it quite
>> > > > > good.
>> > > > > >>>
>> > > > > >>> Is this code sample good enough for you to start with?
>> > > > > >>>
>> > > > > >>> Kind regards,
>> > > > > >>>  Matthias
>> > > > > >>>
>> > > > > >>> -----Original Message-----
>> > > > > >>> From: Gilad Denneboom [mailto:[email protected]]
>> > > > > >>> Sent: Donnerstag, 22. Juni 2017 12:04
>> > > > > >>> To: [email protected]
>> > > > > >>> Subject: Re: Adding a Redaction annotation (without applying
>> > > > > >>> it)
>> > > > > >>>
>> > > > > >>> Yes, I'll be very happy to get some sample code... Is it
>> > > > > >>> related to this issue?
>> > > > > >>> https://issues.apache.org/jira/browse/PDFBOX-3164
>> > > > > >>>
>> > > > > >>> Thanks in advance!
>> > > > > >>>
>> > > > > >>> On Thu, Jun 22, 2017 at 11:52 AM, Stoll, Matthias <
>> > > > > >>> [email protected]>
>> > > > > >>> wrote:
>> > > > > >>>
>> > > > > >>> > Hi Gilad,
>> > > > > >>> >
>> > > > > >>> > Yes - by "stamping" I mean applying the redactions (i.e.
>> > > > > >>> > texts, boxes, arrows - everything that XFDF allows) onto
>> > > > > >>> > the PDF and then exporting a new one.
>> > > > > >>> > We do this as part of a rendering component for electronic
>> > files.
>> > > > > >>> > Therefore we take 2 file:
>> > > > > >>> > 1) the original PDF (unmodified)
>> > > > > >>> > 2) the annotation file as XFDF Then we merge them together
>> > > > > >>> > on the fly and give it to the viewing component as a
>> > > > > >>> > readonly new temporary PDF document.
>> > > > > >>> >
>> > > > > >>> > XFDF is supported by Adobe and other viewers, i.e. Qoppa
>> > > > > >>> > viewer and the Foxit Web Viewer also directly deal with
>> > > > > >>> > XFDF as separate
>> > > > > files.
>> > > > > >>> > You give them both files and they merge it for display on
>> > > > > >>> > the
>> > > fly.
>> > > > > >>> > When using PDF.js as a viewer or another component which
>> > > > > >>> > natively does not support XFDF annotations, you might go
>> > > > > >>> > the same way as we do - render on the fly.
>> > > > > >>> >
>> > > > > >>> > If you need some sample code ("XFDF stamping") to start
>> > > > > >>> > with, we might be happy to help.
>> > > > > >>> > Tilman and the PDFBox team were so kind to help us
>> > > > > >>> > initially here, so we might help you now and give some
>> knowhow back.
>> > > > > >>> >
>> > > > > >>> > Kind regards,
>> > > > > >>> >  Matthias
>> > > > > >>> >
>> > > > > >>> > -----Original Message-----
>> > > > > >>> > From: Gilad Denneboom [mailto:[email protected]]
>> > > > > >>> > Sent: Donnerstag, 22. Juni 2017 10:53
>> > > > > >>> > To: [email protected]
>> > > > > >>> > Subject: Re: Adding a Redaction annotation (without
>> > > > > >>> > applying
>> > > > > >>> > it)
>> > > > > >>> >
>> > > > > >>> > Hi Matthias,
>> > > > > >>> >
>> > > > > >>> > Thanks for the info.
>> > > > > >>> > What do you mean exactly by "stamping" the XFDF file,
>> though?
>> > > > > >>> > Do you mean just import it? Does that actually apply the
>> > > redactions?
>> > > > > >>> >
>> > > > > >>> > Gilad
>> > > > > >>> >
>> > > > > >>> > On Thu, Jun 22, 2017 at 10:01 AM, Stoll, Matthias
>> > > > > >>> > <[email protected]>
>> > > > > >>> > wrote:
>> > > > > >>> >
>> > > > > >>> > > Hi Gilad,
>> > > > > >>> > >
>> > > > > >>> > > One approach to do this is by forming redactions based
>> > > > > >>> > > on
>> > XFDF.
>> > > > > >>> > > If you want to apply the XFDF based redactions
>> > > > > >>> > > permanently, you can
>> > > > > >>> "stamp"
>> > > > > >>> > > it later into the PDF.
>> > > > > >>> > > Both is possible by using PDFBox.
>> > > > > >>> > >
>> > > > > >>> > > Kind regards,
>> > > > > >>> > >  Matthias
>> > > > > >>> > >
>> > > > > >>> > > -----Original Message-----
>> > > > > >>> > > From: Gilad Denneboom [mailto:[email protected]]
>> > > > > >>> > > Sent: Donnerstag, 22. Juni 2017 09:47
>> > > > > >>> > > To: [email protected]
>> > > > > >>> > > Subject: Adding a Redaction annotation (without applying
>> > > > > >>> > > it)
>> > > > > >>> > >
>> > > > > >>> > > Hi all,
>> > > > > >>> > >
>> > > > > >>> > > Does anyone know if PDFBox supports adding Redaction
>> > > > > >>> > > annotations? If so, is it a documented feature? Are
>> > > > > >>> > > there any code samples I could
>> > > > > >>> use?
>> > > > > >>> > > I'm not talking about applying them (actually redaction
>> > > > > >>> > > the underlying contents), just creating them...
>> > > > > >>> > > Hopefully it's
>> > > > > possible.
>> > > > > >>> > >
>> > > > > >>> > > Regards, Gilad.
>> > > > > >>> > >
>> > > > > >>> >
>> > > > > >>>
>> > > > > >>
>> > > > > >>
>> > > > > >
>> > > > >
>> > > > > ----------------------------------------------------------------
>> > > > > --
>> > > > > --
>> > > > > - To unsubscribe, e-mail: [email protected]
>> > > > > For additional commands, e-mail: [email protected]
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Reply via email to