pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haddy, Diane E" <diane-ha...@uiowa.edu>
Subject No Class definition error on
Date Thu, 21 Jan 2016 21:01:08 GMT
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

[cid:image001.png@01D1545C.8EFB18C0]

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.
________________________________

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message