Question

Print Selection

Posted 13 years ago by Avatar painetraine
Is there a way to print the selected text using the SyntaxEditor.Print instead of the entire document text?

Thanks

Comments (12)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
There isn't a way right now however I'll add it to the TODO list.

Actipro Software Support
Posted 13 years ago by Marianne
Any word on when this will be included? Thanks.
------------------------------- Marianne
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Marianne,

I've looked at it and the way we have things set up, this isn't a straightforward thing to implement. But I will try and bump it up on the priority list to see if we can get it in soon.

Actipro Software Support
Posted 13 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
As a workaround, would it be possible to load the selected text into a new instance of SyntaxEditor and initiate the print from there? You could even adjust the starting line number used by that instance of Syntax Editor to make sure they line up with the original.

Just a thought...
Posted 13 years ago by Marianne
What about this... can you set up the print output so that it captures the display from the editor and not the complete script. In other words, if I have collapsed regions, I want them to stay collapsed in the print output. Right now, it automatically prints the fully expanded version of the script.

Boyd, the workaround is definitely worth looking into. Thanks.
------------------------------- Marianne
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
I'll add this to the TODO list. It should be easy to add a property to control whether all collapsed nodes are auto-expanded or not in printing.

Actipro Software Support
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
The printing selection option has been added for the next maintenance release.

Actipro Software Support
Posted 3 years ago by Mark Cunningham - Software Engineer, CNC Software, Inc.

Can you post a starting point for print selection?

Mark Cunningham
Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Mark,

If the editor.PrintSettings.PrintDocument.PrinterSettings.PrintRange == PrintRange.Selection then it will print selection.


Actipro Software Support
Posted 3 years ago by Mark Cunningham - Software Engineer, CNC Software, Inc.

I'm using the ActiproSoftware.SyntaxEditor.Wpf.dll assembly, and the PrintDocument and PrintRange don't resolve.  I can't find either keyword in the help or sample application solutoin.  What am I missing?

Thanks.

Mark Cunningham
Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Mark,

This forum thread is for the WinForms SyntaxEditor, so that reply was related to that version.

The WPF version doesn't currently support printing only a selection, mainly because there is no option for us to interact with in .NET 4.0.  I believe Microsoft added an option in .NET 4.5 that allowed the print selection option, but our code still targets .NET 4.0 so we can't work with that yet.  You'd probably have to follow Boyd's suggestion above for now on that platform.


Actipro Software Support
Posted 3 years ago by Mark Cunningham - Software Engineer, CNC Software, Inc.

Ok, that's for this, sorry about posting in the wrong forum. Our code already did the workaround but I noticed that the fonts/colors don't come through. So more work around work todo.

Thanks.

Mark Cunningham
Information The latest build of this product (2018.1 build 0340) was released 2 months ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.