You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Tilman Hausherr <TH...@t-online.de> on 2016/01/21 22:07:57 UTC

Re: No Class definition error on

Maybe something went wrong with the deployment, i.e. that pdfbox jar 
isn't in the .war file?

What IDE are you using?

Tilman

Am 21.01.2016 um 22:01 schrieb Haddy, Diane E:
>
> Hello
>
> I am new to Apache PDFBox.  I have written simple code to display the 
> word “Training” in the pdf.  When I call this method I am receiving a 
> NoClassDefFound error on PDTpye1Font.  Any ideas or suggestions are 
> welcome.
>
> Thank you
>
> Diane
>
> *private**byte*[] createThePdf() *throws*Exception
>
>      {
>
> ByteArrayOutputStream out = *new*ByteArrayOutputStream();
>
>        PDDocument doc = *new*PDDocument();
>
>        PDPage page = *new*PDPage();
>
>  doc.addPage(page);
>
>  PDPageContentStream content = *new*PDPageContentStream(doc,page);
>
>  content.beginText();
>
>  content.setFont(PDType1Font./HELVETICA_BOLD/, 26);
>
>  content.moveTextPositionByAmount(220,750);
>
>  content.drawString("TRAINING");
>
>  content.endText();
>
>  content.close();
>
>  doc.save(out);
>
>        doc.close();
>
> *return*out.toByteArray();
>
>      }
>
> /Diane Haddy/
>
> /Application Developer/
>
> /Health Care Information Systems/
>
> /Phone (319) 384-9725///
>
> /University of Iowa Hospitals & Clinics, S363-CDD/
>
> /200 Hawkins Drive, Iowa City, IA  52242/
>
>
>
> ------------------------------------------------------------------------
> Notice: This UI Health Care e-mail (including attachments) is covered 
> by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is 
> confidential and may be legally privileged.  If you are not the 
> intended recipient, you are hereby notified that any retention, 
> dissemination, distribution, or copying of this communication is 
> strictly prohibited.  Please reply to the sender that you have 
> received the message in error, then delete it. Thank you.
> ------------------------------------------------------------------------


RE: No Class definition error on

Posted by "Haddy, Diane E" <di...@uiowa.edu>.
I am using eclipse as my IDE.  I have pdfBox.jar in WEB-INF/lib directory.  I searched this error online and someone referenced fontbox-1.8.11.jar file.  So I downloaded it too.  Now it works.

Thank you very much for replying to my email so quickly.

Diane

-----Original Message-----
From: Tilman Hausherr [mailto:THausherr@t-online.de]
Sent: Thursday, January 21, 2016 3:08 PM
To: users@pdfbox.apache.org
Subject: Re: No Class definition error on

Maybe something went wrong with the deployment, i.e. that pdfbox jar isn't in the .war file?

What IDE are you using?

Tilman

Am 21.01.2016 um 22:01 schrieb Haddy, Diane E:
>
> Hello
>
> I am new to Apache PDFBox.  I have written simple code to display the
> word "Training" in the pdf.  When I call this method I am receiving a
> NoClassDefFound error on PDTpye1Font.  Any ideas or suggestions are
> welcome.
>
> Thank you
>
> Diane
>
> *private**byte*[] createThePdf() *throws*Exception
>
>      {
>
> ByteArrayOutputStream out = *new*ByteArrayOutputStream();
>
>        PDDocument doc = *new*PDDocument();
>
>        PDPage page = *new*PDPage();
>
>  doc.addPage(page);
>
>  PDPageContentStream content = *new*PDPageContentStream(doc,page);
>
>  content.beginText();
>
>  content.setFont(PDType1Font./HELVETICA_BOLD/, 26);
>
>  content.moveTextPositionByAmount(220,750);
>
>  content.drawString("TRAINING");
>
>  content.endText();
>
>  content.close();
>
>  doc.save(out);
>
>        doc.close();
>
> *return*out.toByteArray();
>
>      }
>
> /Diane Haddy/
>
> /Application Developer/
>
> /Health Care Information Systems/
>
> /Phone (319) 384-9725///
>
> /University of Iowa Hospitals & Clinics, S363-CDD/
>
> /200 Hawkins Drive, Iowa City, IA  52242/
>
>
>
> ----------------------------------------------------------------------
> --
> Notice: This UI Health Care e-mail (including attachments) is covered
> by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged.  If you are not the
> intended recipient, you are hereby notified that any retention,
> dissemination, distribution, or copying of this communication is
> strictly prohibited.  Please reply to the sender that you have
> received the message in error, then delete it. Thank you.
> ----------------------------------------------------------------------
> --



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________

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