Unspecified errorUnable to layout page 1

27 views
Skip to first unread message

Andre Kullmann

unread,
Oct 26, 2009, 3:32:03 PM10/26/09
to SWT PaperClips
Hi,

i try to print a simple image, my code looks like

ImageLoader loader = new ImageLoader();
ImageData[] data = loader.load("c:/test.png");

PaperClips.print( new PrintJob("test", new ImagePrint(data[0]) ), new
Printer( printerData ) );

And this Exception is thrown

org.eclipse.swt.SWTError: Unspecified errorUnable to layout page 1
at org.eclipse.swt.SWT.error(SWT.java:3803)
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)

I don't know whats going wrong. Is there an example 'how to print an
image in paperclipse' ?

Thanks,
André

Matthew Hall

unread,
Oct 26, 2009, 4:30:44 PM10/26/09
to SWT PaperClips
Your ImagePrint is too big for the page. Wrap it in a ScalePrint and
it should print fine.

Matthew

On Oct 26, 1:32 pm, Andre Kullmann <andre.kullm...@googlemail.com>
wrote:

Andre Kullmann

unread,
Oct 26, 2009, 4:55:48 PM10/26/09
to SWT PaperClips
Wow,

now it works.

I think the error should contain an more significant error message.

Thanks,
André

Reply all
Reply to author
Forward
0 new messages