1. Jay Madren
  2. Valentina Reports ADK
  3. Вторник, Ноябрь 28 2017, 03:57 AM
  4.  Подписаться через email
I am trying to print a report in Xojo using the PreviewPage image, because I need to open a standard printing dialog for the user to select a printer and make adjustments to the printout (choose printer, which pages to print, color vs. b/w, etc). But the "default" PreviewPage image resolution is too low for a quality report on a full letter sized page. So I tried increasing PreviewZoom and also PreviewWidth and PreviewHeight, but none of these causes the following PreviewPage function to change - it continues to output the same lower resolution image.

Why aren't PreviewZoom, PreviewWidth and PreviewHeight having any effect on PreviewPage? Or how else can I get a higher resolution image for printing? Note that PrintToLocalPrinter produces acceptable quality printouts, but I can't use a standard printing dialog with this to allow the user to choose the printer and other options.
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
No response yet?

How do I get a quality printed report while using the standard print dialog?
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Jack,

PreviewZoom should make the image bigger, it is used in the examples:

mReport.PreviewZoom = Val( efZoom.Text )
mPicture = mReport.PreviewPage( 1 )

It is not a good way to print something anyway - everything is rasterized, more data is transferred to the printer.

You can set all major options in the PrintToLocalPrinter, but I'm not sure if it is possible to get printing parameters from the standard dialog in Xojo.

Dim p As New PageSetup
g = OpenPrinterDialog(p)

If p.SetupString contains the options in understandable format - then you can use it for PrintToLocalPrinter.
But it may be device dependent, no description in Xojo docs.

For example, on Windows in the Valentina Studio we show the standard dialog, grab parameters from it using the Windows API and pass them to PrintToLocalPrinter. On other platforms (or for server printing) a custom dialog is used.
Комментарий
There are no comments made yet.
Jay Madren Ответ принят

PreviewZoom should make the image bigger

Yes, it should make it bigger, but it doesn't. At least not for me.


You can set all major options in the PrintToLocalPrinter, but I'm not sure if it is possible to get printing parameters from the standard dialog in Xojo.

Major options, yes. But not all options I need to use.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Then please post your code where you set zoom and make a preview.

Here's how it works in example:
Ссылки
  1. https://www.dropbox.com/s/wy1eqzqqjovefgf/preview_zoom.mp4?dl=0
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
Then please post your code where you set zoom and make a preview.:


// vr is an already setup report
vr.PreviewZoom = 100
Dim pict1 As Picture = vr.PreviewPage( 1 )
vr.PreviewZoom = 200
Dim pict2 As Picture = vr.PreviewPage( 1 )
MsgBox "100% Zoom = " + Str( pict1.Width ) + " x " + Str( pict1.Height ) + EndOfLine _
+ "200% Zoom = " + Str( pict2.Width ) + " x " + Str( pict2.Height )

I get the same picture dimensions for both. Both Mac and Windows.
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
Here's how it works in example:

Hmm...I loaded your example project to test and it works!

So I added the following line to the ShowInfo method:

If mPicture <> Nil Then wProperties.SetPropValue( "Picture Width:", Str(mPicture.Width) )

LIke my example, the picture width doesn't change when using different zoom values, yet the image is zoomed in the canvas. How can this be? I can't find anywhere that the canvas is zooming the image on its own, yet the image is being zoomed!
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Found a problem - not entire page is scaled.

We can add more parameters - page ranges, for example.
But the problem is that printer may have device-specific parameters, they will be unused.

Another option is to generate a PDF file and print it, but it is done using external plugins.
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories