Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » [paperclips] Printing error when there are some kind of images(The presence of some images triggers printing failure)
[paperclips] Printing error when there are some kind of images [message #544765] Mon, 05 July 2010 09:10 Go to next message
Raffaele Gambelli is currently offline Raffaele Gambelli
Messages: 27
Registered: July 2009
Junior Member
Hi all,

I'm using Paperclips to do some printing inside an rcp application.

My printings are in the form of table where each row shows some properties of an instance of a model object.

One of these properties is an image, a small image that I have scaled using SWT api and that I'm using in many parts of this application.

So, is there someone who have experienced some problems trying to print images with Paperclips?

Thanks in advance and best regards
Raffaele
Re: [paperclips] Printing error when there are some kind of images [message #544916 is a reply to message #544765] Tue, 06 July 2010 00:46 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew Hall
Messages: 368
Registered: July 2009
Senior Member
Raffaele,

I'm the maintainer for PaperClips. I'm not aware of any problems with
the ImagePrint API.

Can you describe the image problem in more detail? Please include code
samples and what operating system you are using.

Matthew

On 07/05/2010 07:10 AM, Raffaele Gambelli wrote:
> Hi all,
>
> I'm using Paperclips to do some printing inside an rcp application.
>
> My printings are in the form of table where each row shows some
> properties of an instance of a model object.
>
> One of these properties is an image, a small image that I have scaled
> using SWT api and that I'm using in many parts of this application.
>
> So, is there someone who have experienced some problems trying to print
> images with Paperclips?
>
> Thanks in advance and best regards
> Raffaele
Re: [paperclips] Printing error when there are some kind of images [message #545428 is a reply to message #544916] Wed, 07 July 2010 13:51 Go to previous messageGo to next message
Raffaele Gambelli is currently offline Raffaele Gambelli
Messages: 27
Registered: July 2009
Junior Member
First of all, the exception is this:

19:44:08,171 ERROR [PrintAction] Printing failure
org.eclipse.swt.SWTError: Unspecified errorUnable to layout page 1
at org.eclipse.swt.SWT.error(SWT.java:4109)
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)

In that case I have onl two rows with the following structure:
"c:36 d:g d:g" and some others "d:g"

In the first column I put the image with ImagePrint.
I've choosed to use c:36 after some expriments in another printing where I had many many columns.... and so, sometimes, image column could be too small throwing exceptions...

Choosing to put a fixed width for image column was the solution!

Now, I have few columns, the first is always an image, but now the images have width higher than height, and so, I don't know why, I have always the above exception.

Putting d:g instead of c:36 works!!!

Anyway I suspect that there are many bugs in the image management...
Is it possible to have some guide lines Matthew to print images and to layout them inside a table like layout?

Thanks again and best regards
Raffaele
Re: [paperclips] Printing error when there are some kind of images [message #546191 is a reply to message #545428] Mon, 12 July 2010 01:43 Go to previous message
Matthew Hall is currently offline Matthew Hall
Messages: 368
Registered: July 2009
Senior Member
I think what you have is a conflict between the ImagePrint size (which
is determined by the image pixel size and whatever size/dpi you set on
it) and the fixed column width in your grid column.

I suggest wrapping the ImagePrint in a ScalePrint to automatically scale
down the image when necessary and see if that helps.

Matthew

On 07/07/2010 11:51 AM, Raffaele Gambelli wrote:
> First of all, the exception is this:
>
> 19:44:08,171 ERROR [PrintAction] Printing failure
> org.eclipse.swt.SWTError: Unspecified errorUnable to layout page 1
> at org.eclipse.swt.SWT.error(SWT.java:4109)
> 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)
>
> In that case I have onl two rows with the following structure:
> "c:36 d:g d:g" and some others "d:g"
>
> In the first column I put the image with ImagePrint.
> I've choosed to use c:36 after some expriments in another printing where
> I had many many columns.... and so, sometimes, image column could be too
> small throwing exceptions...
>
> Choosing to put a fixed width for image column was the solution!
>
> Now, I have few columns, the first is always an image, but now the
> images have width higher than height, and so, I don't know why, I have
> always the above exception.
>
> Putting d:g instead of c:36 works!!!
>
> Anyway I suspect that there are many bugs in the image management...
> Is it possible to have some guide lines Matthew to print images and to
> layout them inside a table like layout?
>
> Thanks again and best regards
> Raffaele
Re: [paperclips] Printing error when there are some kind of images [message #599897 is a reply to message #544916] Wed, 07 July 2010 13:51 Go to previous message
Raffaele Gambelli is currently offline Raffaele Gambelli
Messages: 27
Registered: July 2009
Junior Member
First of all, the exception is this:

19:44:08,171 ERROR [PrintAction] Printing failure
org.eclipse.swt.SWTError: Unspecified errorUnable to layout page 1
at org.eclipse.swt.SWT.error(SWT.java:4109)
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)

In that case I have onl two rows with the following structure:
"c:36 d:g d:g" and some others "d:g"

In the first column I put the image with ImagePrint.
I've choosed to use c:36 after some expriments in another printing where I had many many columns.... and so, sometimes, image column could be too small throwing exceptions...

Choosing to put a fixed width for image column was the solution!

Now, I have few columns, the first is always an image, but now the images have width higher than height, and so, I don't know why, I have always the above exception.

Putting d:g instead of c:36 works!!!

Anyway I suspect that there are many bugs in the image management...
Is it possible to have some guide lines Matthew to print images and to layout them inside a table like layout?

Thanks again and best regards
Raffaele
Re: [paperclips] Printing error when there are some kind of images [message #599947 is a reply to message #599897] Mon, 12 July 2010 01:43 Go to previous message
Matthew Hall is currently offline Matthew Hall
Messages: 368
Registered: July 2009
Senior Member
I think what you have is a conflict between the ImagePrint size (which
is determined by the image pixel size and whatever size/dpi you set on
it) and the fixed column width in your grid column.

I suggest wrapping the ImagePrint in a ScalePrint to automatically scale
down the image when necessary and see if that helps.

Matthew

On 07/07/2010 11:51 AM, Raffaele Gambelli wrote:
> First of all, the exception is this:
>
> 19:44:08,171 ERROR [PrintAction] Printing failure
> org.eclipse.swt.SWTError: Unspecified errorUnable to layout page 1
> at org.eclipse.swt.SWT.error(SWT.java:4109)
> 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)
>
> In that case I have onl two rows with the following structure:
> "c:36 d:g d:g" and some others "d:g"
>
> In the first column I put the image with ImagePrint.
> I've choosed to use c:36 after some expriments in another printing where
> I had many many columns.... and so, sometimes, image column could be too
> small throwing exceptions...
>
> Choosing to put a fixed width for image column was the solution!
>
> Now, I have few columns, the first is always an image, but now the
> images have width higher than height, and so, I don't know why, I have
> always the above exception.
>
> Putting d:g instead of c:36 works!!!
>
> Anyway I suspect that there are many bugs in the image management...
> Is it possible to have some guide lines Matthew to print images and to
> layout them inside a table like layout?
>
> Thanks again and best regards
> Raffaele
Previous Topic:[CompositeTable] - Resize of column causes scrollbar to appear in Header
Next Topic:Adding a blank row to nebula tableCombo
Goto Forum:
  


Current Time: Wed Aug 20 10:50:35 EDT 2014

Powered by FUDForum. Page generated in 0.02439 seconds