You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Blake McBride <bl...@gmail.com> on 2016/03/06 19:57:30 UTC

2.0.0-RC3 Can't find AppendMode

Hi,

I am using pdfbox-2.0.0-RC3.jar.  I can't seen to find the AppendMode
enum.  My IDE (intelliJ) tells me:


import org.apache.pdfbox.pdmodel.PDPageContentStream;  exists

import org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode;  does not exist


and there is no PDPageContentStream.AppendMode

I was getting my example code from:

https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateLandscapePDF.java?view=markup


Not sure what to do.  Seems like it just flat out doesn't work.


Appreciate any help.


Blake McBride

Re: 2.0.0-RC3 Can't find AppendMode

Posted by Blake McBride <bl...@gmail.com>.
That fixed it.  Thanks!!

On Sun, Mar 6, 2016 at 1:28 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> You need to use Fontbox too. Alternatively, use pdfbox-app which has all.
> See also the dependencies.
>
> Tilman
>
>
> Am 06.03.2016 um 20:26 schrieb Blake McBride:
>
>> Okay.  Thanks.  I switched to pdfbox-2.0.0-20160304.180026-2013.jar and
>> that fixed the problem.  However, now when I run the test app, I get:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/fontbox/FontBoxFont
>>         at main(Test.java:25)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at
>> com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.fontbox.FontBoxFont
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>>         ... 6 more
>>
>> Process finished with exit code 1
>>
>> I do not know anything about FontBoxFont.  It appears to me that pdfbox
>> 2.x
>> may not be ready for prime-time.  Do suggest I just switch to 1.x?
>>
>> Thanks.
>>
>> Blake McBride
>>
>>
>> On Sun, Mar 6, 2016 at 1:01 PM, Tilman Hausherr <TH...@t-online.de>
>> wrote:
>>
>> Am 06.03.2016 um 19:57 schrieb Blake McBride:
>>>
>>> Hi,
>>>>
>>>> I am using pdfbox-2.0.0-RC3.jar.  I can't seen to find the AppendMode
>>>> enum.  My IDE (intelliJ) tells me:
>>>>
>>>>
>>>> import org.apache.pdfbox.pdmodel.PDPageContentStream;  exists
>>>>
>>>> import org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode;  does
>>>> not exist
>>>>
>>>>
>>>> and there is no PDPageContentStream.AppendMode
>>>>
>>>> I was getting my example code from:
>>>>
>>>>
>>>>
>>>> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateLandscapePDF.java?view=markup
>>>>
>>>> The AppendMode may have been done in the last minute, i.e. not in RC3.
>>> The
>>> best would be that you either get the -SNAPSHOT version from maven, or
>>> download the source code and find it there.
>>>
>>> Here's the line in old style:
>>>
>>>
>>>              PDPageContentStream contentStream = new
>>> PDPageContentStream(doc, page, false, false);
>>>
>>>
>>> Tilman
>>>
>>>
>>> Not sure what to do.  Seems like it just flat out doesn't work.
>>>>
>>>>
>>>> Appreciate any help.
>>>>
>>>>
>>>> Blake McBride
>>>>
>>>>

Re: 2.0.0-RC3 Can't find AppendMode

Posted by Tilman Hausherr <TH...@t-online.de>.
You need to use Fontbox too. Alternatively, use pdfbox-app which has 
all. See also the dependencies.

Tilman

Am 06.03.2016 um 20:26 schrieb Blake McBride:
> Okay.  Thanks.  I switched to pdfbox-2.0.0-20160304.180026-2013.jar and
> that fixed the problem.  However, now when I run the test app, I get:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/fontbox/FontBoxFont
> 	at main(Test.java:25)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
> Caused by: java.lang.ClassNotFoundException: org.apache.fontbox.FontBoxFont
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> 	... 6 more
>
> Process finished with exit code 1
>
> I do not know anything about FontBoxFont.  It appears to me that pdfbox 2.x
> may not be ready for prime-time.  Do suggest I just switch to 1.x?
>
> Thanks.
>
> Blake McBride
>
>
> On Sun, Mar 6, 2016 at 1:01 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Am 06.03.2016 um 19:57 schrieb Blake McBride:
>>
>>> Hi,
>>>
>>> I am using pdfbox-2.0.0-RC3.jar.  I can't seen to find the AppendMode
>>> enum.  My IDE (intelliJ) tells me:
>>>
>>>
>>> import org.apache.pdfbox.pdmodel.PDPageContentStream;  exists
>>>
>>> import org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode;  does
>>> not exist
>>>
>>>
>>> and there is no PDPageContentStream.AppendMode
>>>
>>> I was getting my example code from:
>>>
>>>
>>> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateLandscapePDF.java?view=markup
>>>
>> The AppendMode may have been done in the last minute, i.e. not in RC3. The
>> best would be that you either get the -SNAPSHOT version from maven, or
>> download the source code and find it there.
>>
>> Here's the line in old style:
>>
>>
>>              PDPageContentStream contentStream = new
>> PDPageContentStream(doc, page, false, false);
>>
>>
>> Tilman
>>
>>
>>> Not sure what to do.  Seems like it just flat out doesn't work.
>>>
>>>
>>> Appreciate any help.
>>>
>>>
>>> Blake McBride
>>>
>>>
>> ---------------------------------------------------------------------
>> 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


Re: 2.0.0-RC3 Can't find AppendMode

Posted by Blake McBride <bl...@gmail.com>.
Okay.  Thanks.  I switched to pdfbox-2.0.0-20160304.180026-2013.jar and
that fixed the problem.  However, now when I run the test app, I get:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/fontbox/FontBoxFont
	at main(Test.java:25)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.apache.fontbox.FontBoxFont
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 6 more

Process finished with exit code 1

I do not know anything about FontBoxFont.  It appears to me that pdfbox 2.x
may not be ready for prime-time.  Do suggest I just switch to 1.x?

Thanks.

Blake McBride


On Sun, Mar 6, 2016 at 1:01 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 06.03.2016 um 19:57 schrieb Blake McBride:
>
>> Hi,
>>
>> I am using pdfbox-2.0.0-RC3.jar.  I can't seen to find the AppendMode
>> enum.  My IDE (intelliJ) tells me:
>>
>>
>> import org.apache.pdfbox.pdmodel.PDPageContentStream;  exists
>>
>> import org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode;  does
>> not exist
>>
>>
>> and there is no PDPageContentStream.AppendMode
>>
>> I was getting my example code from:
>>
>>
>> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateLandscapePDF.java?view=markup
>>
>
> The AppendMode may have been done in the last minute, i.e. not in RC3. The
> best would be that you either get the -SNAPSHOT version from maven, or
> download the source code and find it there.
>
> Here's the line in old style:
>
>
>             PDPageContentStream contentStream = new
> PDPageContentStream(doc, page, false, false);
>
>
> Tilman
>
>
>>
>> Not sure what to do.  Seems like it just flat out doesn't work.
>>
>>
>> Appreciate any help.
>>
>>
>> Blake McBride
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: 2.0.0-RC3 Can't find AppendMode

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 06.03.2016 um 19:57 schrieb Blake McBride:
> Hi,
>
> I am using pdfbox-2.0.0-RC3.jar.  I can't seen to find the AppendMode
> enum.  My IDE (intelliJ) tells me:
>
>
> import org.apache.pdfbox.pdmodel.PDPageContentStream;  exists
>
> import org.apache.pdfbox.pdmodel.PDPageContentStream.AppendMode;  does not exist
>
>
> and there is no PDPageContentStream.AppendMode
>
> I was getting my example code from:
>
> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateLandscapePDF.java?view=markup

The AppendMode may have been done in the last minute, i.e. not in RC3. 
The best would be that you either get the -SNAPSHOT version from maven, 
or download the source code and find it there.

Here's the line in old style:


             PDPageContentStream contentStream = new 
PDPageContentStream(doc, page, false, false);


Tilman

>
>
> Not sure what to do.  Seems like it just flat out doesn't work.
>
>
> Appreciate any help.
>
>
> Blake McBride
>


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