Hi all,
I'm having the same problem, the printPreview works fine on windows
and linux, but it fails on mac.
I've noticed that if I don't have any printer configured on the mac
then the printPreview dialog appears and the print image is empty. If
I define a printer, the printPreview dialog doesn't even show and I
get this exception:
java.lang.NullPointerException
at org.eclipse.swt.printing.Printer.internal_new_GC(Printer.java:307)
at org.eclipse.swt.graphics.GC.<init>(GC.java:169)
at org.eclipse.swt.graphics.GC.<init>(GC.java:132)
at net.sf.paperclips.ui.PrintPreview.getGC(PrintPreview.java:507)
at net.sf.paperclips.ui.PrintPreview.fetchPages(PrintPreview.java:
535)
at net.sf.paperclips.ui.PrintPreview.getPageCount(PrintPreview.java:
188)
at
it.ansa.one.gui.ui.print.PrintPreviewDialog.updatePageNumber(Unknown
Source)
at
it.ansa.one.gui.ui.print.PrintPreviewDialog.createDialogArea(Unknown
Source)
I'll try to investigate the problem, did you already find a solution
for this?
Thanks,
Fabian
On 26 Apr, 21:39, "Matthew Hall" <
matth...@woodcraftmill.com> wrote:
> I suspect this has to do with how PrintPreview achieves WYSIWYG: the printer is instantiated, then we create an image the size of the preview on the printer instance and render the page onto that Image. We then grab the ImageData from the image and create a copy on the Display side. Then we render the display image to the display.
>
> My guess is that the rendering to the printer Image is not working.
>
> Matthew
>
> -- Sent from my Palm Pre
> On Apr 25, 2010 12:55 PM, Nick &
lt;n...@transparentech.com> wrote:
>
> Hi. I'm trying to use PaperClips with SWT Cocoa. I'm using the code
>
> from the Paperclips Article (
http://hexapixel.com/2009/09/18/printing-
>
> swt-tables-with-paperclips), but also tried it outside of that code
>
> base using only a modified version of the PrintPreviewDialog.
>
> The code works fine in Linux, but with Mac Cocoa (both 32 and 64 bit
>
> versions), the preview dialog shows an empty area where the document
>
> should be. I can print the document, but the preview portion never
>
> displays.
>
> I assume that the problem is not with Paperclips, but with SWT Cocoa.
>
> However, I was wondering if anyone had any thoughts as to where to
>
> start looking? Could this be a problem with SWT Cocoa GC? or the
>
> Canvas? or even with PaperClips PrintPreview widget?
>
> Thanks for any assistance.
>
> Nick
>
> --
>
> You received this message because you are subscribed to the Google Groups "SWT PaperClips" group.
>
> To post to this group, send email to
swt-pap...@googlegroups.com.
>
> To unsubscribe from this group, send email to
swt-paperclip...@googlegroups.com.
>
> For more options, visit this group athttp://
groups.google.com/group/swt-paperclips?hl=en.
> For more options, visit this group athttp://
groups.google.com/group/swt-paperclips?hl=en.