PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) Troubleshooting Tiff Image Loader causing problems running a Lotus Notes age Re: Re: Tiff Image Loader causing problems running a Lotus Notes age

#28051

I suspect we are actually dealing with two problems. I’ve isolated the test case by creating the large HTML file that is to be converted to PDF using PD4ML and verified that it works in my IDE (Eclipse) When trying to convert the file using the exact same code as Notes agent it fails with the following dump: (Kindly read until end as there is more explanation after the dump)
<br /> BlockElement(body) {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@662f662f, display=block, width=900, margin-left=10, margin-top=0, margin-bottom=8, margin-right=8, font-size=16}<br /> ContentElement(pd4content) [ ] {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@662f662f, display=block, font-size=16}<br /> ContentElement(pd4content) [ ] {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@662f662f, display=block, font-size=16}<br /> <br /> com.sun.media.jai.codecimpl.util.ImagingException<br /> at com.sun.media.jai.codecimpl.ImagingListenerProxy.errorOccurred(ImagingListenerProxy.java:71)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:218)<br /> at com.cmti.pdfgen.TiffImageLoader.readAndConvertTiff(TiffImageLoader.java:87)<br /> at com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes(TiffImageLoader.java:62)<br /> at org.zefer.cache.ResourceCache.getObjectAlternativeWay(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.thisvoid(Unknown Source)<br /> at org.zefer.html.doc.n.Õõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.if(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br /> Caused by: com.sun.media.jai.codecimpl.util.ImagingException: IOException occurs when encode the image.<br /> ... 22 more<br /> Caused by: java.io.IOException: reading encoded JPEG Stream<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:484)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:240)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:215)<br /> ... 21 more<br /> Caused by:<br /> com.sun.media.jai.codecimpl.util.ImagingException: IOException occurs when encode the image.<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:218)<br /> at com.cmti.pdfgen.TiffImageLoader.readAndConvertTiff(TiffImageLoader.java:87)<br /> at com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes(TiffImageLoader.java:62)<br /> at org.zefer.cache.ResourceCache.getObjectAlternativeWay(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.thisvoid(Unknown Source)<br /> at org.zefer.html.doc.n.Õõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.if(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br /> Caused by: java.io.IOException: reading encoded JPEG Stream<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:484)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:240)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:215)<br /> ... 21 more<br /> Caused by:<br /> java.io.IOException: reading encoded JPEG Stream<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:484)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:240)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:215)<br /> at com.cmti.pdfgen.TiffImageLoader.readAndConvertTiff(TiffImageLoader.java:87)<br /> at com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes(TiffImageLoader.java:62)<br /> at org.zefer.cache.ResourceCache.getObjectAlternativeWay(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.thisvoid(Unknown Source)<br /> at org.zefer.html.doc.n.Õõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.if(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br /> Exception in thread "AgentThread: JavaAgent" java.lang.OutOfMemoryError<br /> at java.lang.StringBuffer.ensureCapacityImpl(StringBuffer.java:335)<br /> at java.lang.StringBuffer.append(StringBuffer.java:201)<br /> at org.zefer.pd4ml.pdf.c.Ôo0000(Unknown Source)<br /> at org.zefer.pd4ml.pdf.PD4Device.isNewPageNeeded(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br />

I have three copies of the HTML file. One with no images at all and it runs fine in Both Eclipse and as a Notes agent. One with a small (4k) .png image in the header of every other page for a total of 100 images in a 200 page PDF. This also runs to completion in both Eclipse and Notes. The third HTML file has the same header images as the second and 4 TIFF images (one each on the 2nd, 4th, 6th and 8th page of the 200 page PDF output) This file runs fine on Eclipse but fails in the Notes agent with the above dump. The image sizes you requested for TiffImageLoader.getResourceAsBytes are:
<br /> Image URL: file:///C:UsersXXXXXXXXXX/038/038011074/WS/057008072_WS.TIF<br /> BYTE SIZE: 31982<br /> Image URL: file:///C:UsersXXXXXXXXXX/028/028009113/WS/041013397_WS.TIF<br /> BYTE SIZE: 48640<br /> Image URL: file:///C:UsersXXXXXXXXXX/028/028009113/WS/047020674_WS.TIF<br /> BYTE SIZE: 48640<br /> Image URL: file:///C:UsersXXXXXXXXXX/048/048008877/WS/051006769_WS.TIF<br /> BYTE SIZE: 40704<br />
Note that the TiffImageLoader class is one that you supplied in your examples.