CasaDelGato
unread,Jun 10, 2012, 2:01:50 PM6/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to swt-pap...@googlegroups.com
I'm getting this exception when I print a job that has many images in it:
!ENTRY org.eclipse.ui 4 0 2012-06-10 10:57:32.885
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTError: Unspecified errorUnable to layout page 3
at org.eclipse.swt.SWT.error(SWT.java:4308)
at net.sf.paperclips.PaperClips.error(PaperClips.java:82)
at net.sf.paperclips.PaperClips.error(PaperClips.java:70)
at net.sf.paperclips.PaperClips.getPages(PaperClips.java:422)
at net.sf.paperclips.PaperClips.print(PaperClips.java:255)
at net.sf.paperclips.PaperClips.print(PaperClips.java:210)
at net.sf.paperclips.PaperClips.print(PaperClips.java:186)
at com.casadelgato.email.util.MessageUtil.print(MessageUtil.java:609)
The code that adds all the images looks like this:
GridPrint items = new GridPrint("d");
for (int idx = 0; (idx < attachNames.length); idx++) {
String fname = stripFileCID(attachNames[idx]);
if (getFileType(fname) == FileType.IMAGE) {
try {
byte[] data = mRepo.getMessageAttachment(msg.getID(), fname);
logger.debug("file size is {}", data.length);
InputStream in = new ByteArrayInputStream(data);
ImageLoader loader = new ImageLoader();
ImageData[] id = loader.load(in);
if (id.length > 0) {
items.add(new ImagePrint(id[0]));
}
} catch (RemoteException ex) {
logger.error("Remote Exception", ex);
} catch (FileNotFoundException ex) {
items.add(new TextPrint("Missing Attachment File: " + fname));
}
}
}