pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkühler <andr...@lehmi.de>
Subject Re: catch(IOException | COSVisitorException e)
Date Mon, 26 Jun 2017 10:20:14 GMT

> Steve Carr <bigstefanuk@yahoo.co.uk.INVALID> 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 azeem@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-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message