Print through RhinoApp.RunScript() in C#?

hello to all

Please, can someone helps me to resolve this issue?
I need to print through code, but the command _-SavePrintWindowAs its not recognized by rhino. What should I use instead?
I’m doing this:

    string loc = "C:\\Users\\cricri\\Desktop\\hey.pdf";
    RhinoApp.RunScript("_-Print Go _-SavePrintWindowAs \n\"" + loc + "\"\n _-Enter", true);

any clue will be very helpful
thanks in advance
Carlos

it might be because the command doesn’t exist in rhino?

What about using a library? iText# and PDFSharp seem to be popular. I’ll keep digging into the RhinoApp.Runscript version to see if there is any way to pass a filename.

If you run the scripted version of the print command, you should be able to get to this through something like

-_Print Setup View ViewportArea Window -10,-10 Enter 20,20 Enter Enter Enter
1 Like

Can a filename be inserted in that to automate the printing? The iterations I’ve tried seem to not be able to bypass the file explorer window appearing. That being said, I’m no macro wizard.

1 Like

Thanks,
a lot, I have the same question,
where should I place the file name?

regards
C.

There isn’t really a good way to do this in Rhino 5. Rhino 5 doesn’t have a built in PDF printer so it doesn’t know that printing in general is being sent to a file. There is progress being made on this in the Rhino 6 WIP that should be showing up in the next week or two.

1 Like

thanks a lot Steve.
I will do it through a library then

regards
C.

nm. reread post.