cancel
Showing results for 
Search instead for 
Did you mean: 

Help me! Export to pdf from java (problem with font)

Former Member
0 Kudos

I'm trying to export to pdf from a java application. When I run my application with a report that is designed with arial font works great but If my report has a different font (Code 128.ttf) my application doesn't work.



ERROR 58031[main] - com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:719) -  detected an exception: java.lang.NullPointerException

    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)

ago 05, 2014 11:56:22 AM javaapplication3.JavaApplication3 ImportarPDF

Grave: null

com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:237)

    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:147)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:128)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:111)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.if(SourceFile:58)

    at javaapplication3.JavaApplication3.ImportarPDF(JavaApplication3.java:61)

    at javaapplication3.JavaApplication3.main(JavaApplication3.java:48)

Caused by: java.lang.NullPointerException

    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.if(SourceFile:58)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.<init>(SourceFile:53)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.OpenTypeSubsetter.<init>(SourceFile:56)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.if(SourceFile:414)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.a(SourceFile:314)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.<init>(SourceFile:53)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.OpenTypeSubsetter.<init>(SourceFile:56)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.a(SourceFile:1540)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.PdfDocumentManager.if(SourceFile:350)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.PdfAdvancedDocumentModeller.do(SourceFile:348)

    at com.crystaldecisions.reports.exporters.page.pdf.AdobePDFExporter.finalizeExportJob(SourceFile:235)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:652)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:586)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:636)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1943)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.if(SourceFile:414)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.a(SourceFile:314)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.a(SourceFile:1540)

    at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)

    at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)

    at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.PdfDocumentManager.if(SourceFile:350)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.PdfAdvancedDocumentModeller.do(SourceFile:348)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)

    at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)

    at com.crystaldecisions.reports.exporters.page.pdf.AdobePDFExporter.finalizeExportJob(SourceFile:235)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:652)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:586)

    at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:636)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1943)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:223)

    ... 5 more

Exception in thread "main" java.lang.NullPointerException

    at javaapplication3.JavaApplication3.ImportarPDF(JavaApplication3.java:83)

    at javaapplication3.JavaApplication3.main(JavaApplication3.java:48)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)

    at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)

    at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)

    at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)

    at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)

    at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:223)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:147)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:128)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:111)

    at javaapplication3.JavaApplication3.ImportarPDF(JavaApplication3.java:61)

    at javaapplication3.JavaApplication3.main(JavaApplication3.java:48)

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Angel,

first ensure you've deployed the TrueType fonts(in your case 128.ttf) the report uses to the Java JVM.


Also check if the correct value is getting passed to ByteArrayInputStream.


Regards,

Nikhil

Former Member
0 Kudos

thanks Nikhil Joshi but I now returns the following error



com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:237)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:147)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:128)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:111)

    at javaapplication3.JavaApplication3.ImportarPDF(JavaApplication3.java:61)

    at javaapplication3.JavaApplication3.ImportarPDF(JavaApplication3.java:61)

[2014-08-05 12:56:32,750] INFO 89735[main] - com.crystaldecisions.reports.formulas.e.a(SourceFile:83) - Formula {@EMISION} evaluated to: s(NORMAL)

[2014-08-05 12:56:32,750] INFO 89735[main] - com.crystaldecisions.reports.formulas.e.a(SourceFile:83) - Formula {@BacCode} evaluated to: s(*0106201401171268084000110010010000006870000068715*)

[2014-08-05 12:56:32,781] INFO 89766[main] - com.crystaldecisions.reports.formulas.k.a(SourceFile:4554) - Function 'mid' returned: s(001)

[2014-08-05 12:56:32,781] INFO 89766[main] - com.crystaldecisions.reports.formulas.k.a(SourceFile:4554) - Function 'mid' returned: s(001)

    at javaapplication3.JavaApplication3.main(JavaApplication3.java:48)

Caused by: java.lang.NullPointerException

    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.if(SourceFile:58)

[2014-08-05 12:56:32,796] INFO 89781[main] - com.crystaldecisions.reports.formulas.k.a(SourceFile:4554) - Function 'mid' returned: s(000000687)

[2014-08-05 12:56:32,796] INFO 89781[main] - com.crystaldecisions.reports.formulas.e.a(SourceFile:83) - Formula {@NumFact} evaluated to: s(001-001-000000687)

[2014-08-05 12:56:32,828] INFO 89813[main] - com.crystaldecisions.reports.formulas.e.a(SourceFile:83) - Formula {@llevCont} evaluated to: s(NO)

[2014-08-05 12:56:32,937] INFO 89922[main] - com.crystaldecisions.reports.formulas.k.a(SourceFile:4554) - Function 'totext' returned: s(1)

[2014-08-05 12:56:32,937] INFO 89922[main] - com.crystaldecisions.reports.formulas.e.a(SourceFile:83) - Formula {@cantDetfac} evaluated to: s(1)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.<init>(SourceFile:53)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.OpenTypeSubsetter.<init>(SourceFile:56)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.if(SourceFile:414)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.a(SourceFile:314)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.a(SourceFile:1540)

[2014-08-05 12:56:32,937] INFO 89922[main] - com.crystaldecisions.reports.formulas.e.a(SourceFile:83) - Formula {@precioTot} evaluated to: n(500.0)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.PdfDocumentManager.if(SourceFile:350)

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.PdfAdvancedDocumentModeller.do(SourceFile:348)

    at com.crystaldecisions.reports.exporters.page.pdf.AdobePDFExporter.finalizeExportJob(SourceFile:235)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:652)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:586)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:636)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1943)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)

[2014-08-05 12:56:32,953] INFO 89938[main] - com.crystaldecisions.reports.formulas.e.a(SourceFile:83) - Formula {@totalFact} evaluated to: n(560.0)

[2014-08-05 12:56:33,031] INFO 90016[main] - com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.formatPage(SourceFile:244) - Page 1 formatted.

[2014-08-05 12:56:33,046] INFO 90031[main] - com.crystaldecisions.reports.common.logging.LoggerServiceProvider.logInfo(SourceFile:89) - FCM: modelling contents

[2014-08-05 12:56:34,000] INFO 90985[main] - com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.X(SourceFile:363) - Moving to Page 2

[2014-08-05 12:56:34,156]ERROR 91141[main] - com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:719) -  detected an exception: java.lang.NullPointerException

    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.if(SourceFile:58)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.opentype.tables.ControlValueTable.<init>(SourceFile:53)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)

    at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)

    at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)

    at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.OpenTypeSubsetter.<init>(SourceFile:56)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.if(SourceFile:414)

    at com.crystaldecisions.reports.exporters.format.page.pdf.fontembedding.FontEmbeddingSession.a(SourceFile:314)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.r.a(SourceFile:1540)

    at com.crystaldecisions.reports.exporters.format.page.pdf.pdflib.PdfDocumentManager.if(SourceFile:350)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)

    at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)

    at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:223)

    ... 5 more

Exception in thread "main" java.lang.NullPointerException

    at com.crystaldecisions.reports.exporters.format.page.pdf.dom.PdfAdvancedDocumentModeller.do(SourceFile:348)

    at com.crystaldecisions.reports.exporters.page.pdf.AdobePDFExporter.finalizeExportJob(SourceFile:235)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:652)

    at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:586)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:636)

    at javaapplication3.JavaApplication3.ImportarPDF(JavaApplication3.java:85)

    at javaapplication3.JavaApplication3.main(JavaApplication3.java:48)

    at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1943)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)

    at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)

    at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)

    at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)

    at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)

    at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)

    at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)

    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:223)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:147)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:128)

    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:111)

    at javaapplication3.JavaApplication3.ImportarPDF(JavaApplication3.java:61)

    at javaapplication3.JavaApplication3.main(JavaApplication3.java:48)

[2014-08-05 12:56:34,359] INFO 91344[main] - com.businessobjects.reports.sdk.JRCLicenseThrottler.if(SourceFile:172) -  releasing engine request

java.lang.NullPointerException