CasaDelGato
unread,Jun 10, 2012, 2:04:28 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 running into a problem when I try to print a list of images.
The error looks like this:
!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 creates the print job looks like this:
GridPrint items = new GridPrint("d");
String bodytext = msg.getTextBody();
if ((bodytext != null) && (bodytext.length() > 0)) {
items.add(new TextPrint(msg.getTextBody()));
}
String[] attachNames = msg.getAttachmentNames();
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));
}
}
}
result = new PagePrint(header, items, footer);
Any suggestions on what I might be doing wrong?