I am using Eclipse and java, and have two different projects I am looking at (Workspace 1 and Workspace 2). I am working with PDF Images trying to port something from WS1 to WS2. The code being executed is
PDDocument pdfDocument;
... // Set to a valid PDDocument
page = pdfDocument.getPage(0);
in WS1 this works fine. In WS2, pdfDocument has no getPage() method.
I examined the pom file, and both have the following:
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>1.8.10</version>
</dependency>
I looked at the full path for PDDocument, and for both it is "org.apache.pdfbox.pdmodel.PDDocument".
Since I am using eclipse, I can right click and open a definition, which I did in both workspaces for PDDocument:
WS1
/**
* This is the in-memory representation of the PDF document.
* The #close() method must be called once the document is no longer needed.
*
* @author Ben Litchfield
*/
public class PDDocument implements Closeable
{
private static final Log LOG =
LogFactory.getLog(PDDocument.class);
WS2:
/**
* This is the in-memory representation of the PDF document. You need to call
* close() on this object when you are done using it!!
* <p>
* This class implements the {@link Pageable} interface, but since PDFBox
* version 1.3.0 you should be using the {@link PDPageable} adapter instead
* (see <a href="https://issues.apache.org/jira/browse/PDFBOX-788">PDFBOX-788</a>).
*
* @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
* @version $Revision: 1.47 $
*/
public class PDDocument implements Pageable, Closeable
{
/**
* Log instance.
*/
as you can see, these files are different even though their names are the same. I am still sort of new to maven and pom files. I cannot really understand how these can be different or what I should do to get the correct one in WS2. I did maven->update.
Someone will ask what I am trying to accomplish. I am trying to get an array or list or set of all images in a PDF file so I can see whether a specific image is contained in the document. This works fine in WS1.
Any suggestions what to do? I suppose I could email Ben Litchfield ;-)