Re: Adding a Redaction annotation (without applying it)
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 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) 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 >> frank.mehlh...@dxc.com >> >> 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:gilad.denneb...@gmail.com] >> Gesendet: Montag, 26. Juni 2017 14:25 >> An: users@pdfbox.apache.org >> 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 >> 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:gilad.denneb...@gmail.com] >> > Sent: Freitag, 23. Juni 2017 15:58 >> > To: users@pdfbox.apache.org >> > 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 >> > >> > 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:gilad.denneb...@gmail.com] >> > > Sent: Freitag, 23. Juni 2017 09:59 >> > > To: users@pdfbox.apache.org >> > > 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 >> > > >> > > 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:gilad.denneb...@gmail.com] >> > > > Sent: Donnerstag, 22. Juni 2017 17:41 >> > > > To: users@pdfbox.apache.org >> > > > 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 >
Re: Adding a Redaction annotation (without applying it)
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) 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 > frank.mehlh...@dxc.com > > 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:gilad.denneb...@gmail.com] > Gesendet: Montag, 26. Juni 2017 14:25 > An: users@pdfbox.apache.org > 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 > 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:gilad.denneb...@gmail.com] > > Sent: Freitag, 23. Juni 2017 15:58 > > To: users@pdfbox.apache.org > > 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 > > > > 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:gilad.denneb...@gmail.com] > > > Sent: Freitag, 23. Juni 2017 09:59 > > > To: users@pdfbox.apache.org > > > 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 > > > > > > 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:gilad.denneb...@gmail.com] > > > > Sent: Donnerstag, 22. Juni 2017 17:41 > > > > To: users@pdfbox.apache.org > > > > 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
Re: catch(IOException | COSVisitorException e)
Use the source code examples from the source code download, not from some third party websites. Btw COSVisitorException no longer exists in the 2.0.* versions. Tilman Am 26.06.2017 um 11:41 schrieb Steve Carr: import java.io.IOException; import org.apache.pdfbox.exceptions.COSVisitorException; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; /** * * @author Azeem * @Email az...@radixcode.com */ When I compile the following code in netbeans I get Uncompilable source code - package org.apache.pdfbox.exceptions does not exist in relation tocatch(IOException | COSVisitorException e) I downloaded pdfbox-1.6.0-src.zip help steve public class Main { public static void main(String[] args) { System.out.println("Create Simple PDF file with blank Page"); String fileName = "EmptyPdf.pdf"; // name of our file try{ PDDocument doc = new PDDocument(); // creating instance of pdfDoc doc.addPage(new PDPage()); // adding page in pdf doc file doc.save(fileName); // saving as pdf file with name perm doc.close(); // cleaning memory System.out.println("your file created in : "+ System.getProperty("user.dir")); } catch(IOException | COSVisitorException e){ System.out.println(e.getMessage()); } } } - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
AW: Adding a Redaction annotation (without applying it)
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 frank.mehlh...@dxc.com 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:gilad.denneb...@gmail.com] Gesendet: Montag, 26. Juni 2017 14:25 An: users@pdfbox.apache.org 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 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:gilad.denneb...@gmail.com] > Sent: Freitag, 23. Juni 2017 15:58 > To: users@pdfbox.apache.org > 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 > > 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:gilad.denneb...@gmail.com] > > Sent: Freitag, 23. Juni 2017 09:59 > > To: users@pdfbox.apache.org > > 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 > > > > 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:gilad.denneb...@gmail.com] > > > Sent: Donnerstag, 22. Juni 2017 17:41 > > > To: users@pdfbox.apache.org > > > 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:158) > > > 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 > > > > > > 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
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 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:gilad.denneb...@gmail.com] > Sent: Freitag, 23. Juni 2017 15:58 > To: users@pdfbox.apache.org > 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 > 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:gilad.denneb...@gmail.com] > > Sent: Freitag, 23. Juni 2017 09:59 > > To: users@pdfbox.apache.org > > 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 > > > > 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:gilad.denneb...@gmail.com] > > > Sent: Donnerstag, 22. Juni 2017 17:41 > > > To: users@pdfbox.apache.org > > > 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:158) > > > 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 > > > > > > 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:gilad.denneb...@gmail.com] > > > > Sent: Donnerstag, 22. Juni 2017 17:13 > > > > To: users@pdfbox.apache.org > > > > 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 < > > > > gilad.denneb...@gmail.com> > > > > wrote: > > > > > > > > > I've encountered my first stumble-block... When I try t
RE: Adding a Redaction annotation (without applying it)
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:gilad.denneb...@gmail.com] Sent: Freitag, 23. Juni 2017 15:58 To: users@pdfbox.apache.org 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 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:gilad.denneb...@gmail.com] > Sent: Freitag, 23. Juni 2017 09:59 > To: users@pdfbox.apache.org > 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 > > 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:gilad.denneb...@gmail.com] > > Sent: Donnerstag, 22. Juni 2017 17:41 > > To: users@pdfbox.apache.org > > 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:158) > > 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 > > > > 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:gilad.denneb...@gmail.com] > > > Sent: Donnerstag, 22. Juni 2017 17:13 > > > To: users@pdfbox.apache.org > > > 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 < > > > gilad.denneb...@gmail.com> > > > 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(Red
Re: catch(IOException | COSVisitorException e)
> Steve Carr hat am 26. Juni 2017 um 11:41 > geschrieben: > > > import java.io.IOException; > import org.apache.pdfbox.exceptions.COSVisitorException; > import org.apache.pdfbox.pdmodel.PDDocument; > import org.apache.pdfbox.pdmodel.PDPage; > > /** > * > * @author Azeem > * @Email az...@radixcode.com > */ > > > When I compile the following code in netbeans I get > Uncompilable source code - package org.apache.pdfbox.exceptions does not > exist in relation tocatch(IOException | COSVisitorException e) > > I downloaded pdfbox-1.6.0-src.zip Please, update to a more recent version like 2.0.6, yours is quite ancient. Andreas > help > steve > public class Main { > > > public static void main(String[] args) { > > System.out.println("Create Simple PDF file with blank Page"); > > String fileName = "EmptyPdf.pdf"; // name of our file > > try{ > > PDDocument doc = new PDDocument(); // creating instance of pdfDoc > > doc.addPage(new PDPage()); // adding page in pdf doc file > > doc.save(fileName); // saving as pdf file with name perm > > doc.close(); // cleaning memory > > System.out.println("your file created in : "+ > System.getProperty("user.dir")); > > > } > catch(IOException | COSVisitorException e){ > System.out.println(e.getMessage()); > } > > } > > } - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
catch(IOException | COSVisitorException e)
import java.io.IOException; import org.apache.pdfbox.exceptions.COSVisitorException; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; /** * * @author Azeem * @Email az...@radixcode.com */ When I compile the following code in netbeans I get Uncompilable source code - package org.apache.pdfbox.exceptions does not exist in relation tocatch(IOException | COSVisitorException e) I downloaded pdfbox-1.6.0-src.zip help steve public class Main { public static void main(String[] args) { System.out.println("Create Simple PDF file with blank Page"); String fileName = "EmptyPdf.pdf"; // name of our file try{ PDDocument doc = new PDDocument(); // creating instance of pdfDoc doc.addPage(new PDPage()); // adding page in pdf doc file doc.save(fileName); // saving as pdf file with name perm doc.close(); // cleaning memory System.out.println("your file created in : "+ System.getProperty("user.dir")); } catch(IOException | COSVisitorException e){ System.out.println(e.getMessage()); } } }