pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Getting Started with PdfBox
Date Sat, 15 Oct 2016 12:13:46 GMT
Am 15.10.2016 um 13:55 schrieb Joseph Tanner:
> Hello Tilman,
>
>> What is your experience in java software developing? I'm just asking 
>> to be sure that I don't write too much. But if you just started, then 
>> it will be tough...
> My experience in developing is small. I've been managing a big 
> java-app for >10years. But there I add or modify classes and do very 
> few new developement (on Eclipse Standard/SDK Luna Service Release 2).
> I use quite alot the Apache.poi to generate ExcelExports.
>
> For testing I use often cmd like this batch:
> goJavaCandRun8.bat HelloWorld
> --------------------------------
> echo off
> set fileName=%1
> echo das java program : %fileName%
> set JAVAPATH="C:\Program Files\Java\jdk1.8.0_65\bin"
> cd C:\Users\jsail\Desktop\javatest\j8
>
> echo "compile"
> %JAVAPATH%\javac.exe -cp ".;pdfbox-app-2.0.3.jar" %fileName%.java
>
> echo "run"
> %JAVAPATH%\java -cp ".;pdfbox-app-2.0.3.jar" %fileName%
>
> echo open
> cmd /c %fileName%.pdf /e
>
> echo %fileName%
>
> TIMEOUT /T 5
> --------------------------------
> But on 'HelloWorld.java' and 'CreateLandscapePDF.java' throws the 
> error: main class not found.
> (Fehler: Hauptklasse HelloWorld konnte nicht gefunden oder geladen 
> werden)

This doesn't work due to the line "package 
org.apache.pdfbox.examples.pdmodel;" in the source. Remove it and it works.

> The compiling seems to be ok
>
> I tried also to run it on my IntelliJ IDEA (Community Version), but 
> there this error occured:
> Error:(30, 34) java: package org.apache.commons.logging does not exist 
> (Error on pdfBox 2.0.3)

Then get it and add it, or use the pdfbox-app-2.0.3.jar instead.

> Error:(20, 23) java: package junit.framework does not exist (Error on 
> pdfBox 2.0.2 and 1.8.12)
> As the folder-structure is not clear for me, I stopped testing on my 
> IntelliJ IDEA...
>
> Do you know, if there is a projekt aviable, where all the examples can 
> be tested?

I can't tell about IntelliJ because I don't use it. The "examples" 
subproject in the source download is one project of its own, it works 
fine in Netbeans. To start a specific example, you'd either have to 
chose it as main and set up parameter(s), or (what I do), I just add 
code at the beginning like this at the beginning

args   = new String[]{"C:\\SOMEPATH\\filename.pdf","another argument"};

and then right mouse key, "run". Maybe intelliJ has something similar.

Alternatively set up a new project, and add the pdfbox-app-2.0.3.jar 
file as library to the project, that should work as well. If it doesn't, 
then your IDE sucks.

Tilman


>
> Thank you for your patience
> j
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message