We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Printing in VB.NET

I'm trying to print a diagram vb.net VS2013 8.1 app. The statement;

Await Diagram1.PrintingService.RegisterForPrinting()

produces an error - expression does not produce a value.

Removing the await stops the error and allows the app to show the print dialog but then the print preview fails.

Any ideas?


6 Replies

JW jim watterson August 26, 2014 11:16 PM UTC

fter further experimenation I have found that:

I have Diagram1PageSettings = Nothing - which I copied from the examples or documentation. If remove this and add

Diagram1PageSettings .PageWidth =500
Diagram1PageSettings .PageHeight=500

A reversed out block is drawn on top of my diagram corresponding to this size with the line colours inverted. This block then prints but is not what I want.  

All I want is to print my diagram as I see it. The documentation says that PageWiidth & PageHeight should be set by the contents?


SC Saranya Chandrasekaran Syncfusion Team August 28, 2014 06:39 AM UTC

Hi Jim,

Sorry for the inconvenience caused.

Regarding “Printing in VB.NET” to your reported scenario, we have created simple sample to meet your requirement. Currently, we don’t have a support to directly print the Diagram content. We have used Pagesettings to print the Diagram with specified Size. We will update the documentation with necessary information in future. Please refer to the attached sample.

Please let us know if you have any concerns.

Regards,

Saranya C


Attachment: PrintingSample_54cc1b5f.zip


JW jim watterson August 28, 2014 07:02 AM UTC

Thank for your response. I am trying to fit the diagram onto the page if possible and only go to another page if it won't fit. 

If I could set the PageSettings to the printable area of the page then this would work but I cannot see how to retrieve this because i never have access to the printer context - is there an event I can override during the preview call to get the page size?


SC Saranya Chandrasekaran Syncfusion Team August 29, 2014 11:04 AM UTC

Hi Jim,

We are working on your requirement. We will update you on Monday September 1,2014.

Please let us know if you have any concerns.
Regards,
Saranya C


JW jim watterson August 30, 2014 06:45 AM UTC

When I print anything it is hard up against the left and top in the preview. When I print the top and left are chopped off by a few pixels. PrintMargin has no effect. I've set a colour and thickness for the border but it is never displayed. I do not understand what OffPageMaxMargin is for.



MP Mohana Priya Raja Syncfusion Team September 1, 2014 12:47 PM UTC

Hi Jim,

We have analyzed your query. We have provided some virtual method to override the printing functionality in PrintingService. The Print Margin property is used to define the Margin for PageBreaks.

Please refer to our online help documentation link for more details about printing.

Link: http://help.syncfusion.com/UG/winrt/documents/api.htm

It would be better for us, if you provide more details (sample, document or video) to represent your requirement. This helps us to serve you better.

Please let us know if you have any concerns.

Regards,

Mohana Priya R


Loader.
Live Chat Icon For mobile
Up arrow icon