Am 26.03.21 um 20:36 schrieb Jack London:
Hi guys!
*Thank you very very much, Tilman and Andreas!!*
*Andreas was right!* But the hierarchy in Eclipse is not the same as when
you use separate compilation as in your case.
PDFBox uses maven as build tool and therefore the maven standard directory
layout [1] for all files. The missing files in question are resources and are
located in
src/main/resources
Each subproject such as fontbox, pdfbox, preflight and so on has it own
directory with the very same layout.
Maven automatically collects all necessary files when creating a jar so that all
needed files are available when using it. It is not necessary to copy any files
manually.
Eclipse supports many different kind of projects. To open a maven based project
one should use the import wizard as follows
File -> Import ... -> Maven -> Existing Maven Projects -> Choose the main
directory of the unzipped pdfbox sources
I've the impression that you are not doing so which led to the described issues.
Cheers
Andreas
[1]
https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
In Eclipse, the basepath starts at *src. *Suppose that your Eclipse
workspace is called *PDFBox-Workspace*, and that it is somewhere in your
disk, it doesn't matter. Then, suppose that you created a project called
*PDFBox* in this workspace for your PDFBox source code. Then, your
packages/hierarchy starts at:
*PDFBox-Workspace\PDFBox\src*
I debugged and there were two resources missing:
"Identity-H",which is actually in the path:
*PDFBox-Workspace\PDFBox\src*\*org\apache\fontbox\cmap\Identity-H*
and "sRGB.icc" which is actually in the path:
*PDFBox-Workspace\PDFBox\src\org\apache\pdfbox\resources\cmap*
Eclipse completes the partial paths such as
*org\apache\fontbox\cmap\Identity-H* with the absolute path:
*C:\...\PDFBox-Workspace\PDFBox\src\*
*But*, when you copy the file to its place in *src* directory, you
should *refresh
*the project on Eclipse "Package Explorer". This will copy the file to:
*C:\...\PDFBox-Workspace\PDFBox\bin*
When your code executes it "wants" things in the *bin *directory not in the
*src*. That is why you should refresh "Package Explorer". In the case of
Java files, Eclipse compiles the files and copies the class file to *bin*.
But if the file is not a java file it will just copy it there.
Thus, it is possible to compile PDFBox with Eclipse, but the resources must
be put in the way I explained above. Timan, you definitely don't need
maven, 😉
Hope this will help someone!
Thanks again everybody!!
See you next time,
Jack
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]