Find and share HowTos to various installations / configurations!
Kirvesmies
Posts: 42 Joined: Mon Dec 04, 2017 2:28 pm
Post
by Kirvesmies » Fri Jun 29, 2018 1:22 pm
I want to print a whole UI screen. I have a childpanel with a printbutton. Before printing I would like to close or hide the print childpaneldialog.
I tried this code but it results in OA crash. What to do, there is no hidepanel function or panel.visible(0)?
Code: Select all
PanelOffPanel(myPanelName()); //Hide printpanel
printRootPanel(myModuleName(),"",1);
PS. v3.16 P001 development on Windows, Runtime on Linux
mkoller
Posts: 741 Joined: Fri Sep 17, 2010 9:03 am
Post
by mkoller » Fri Jun 29, 2018 2:52 pm
You don't need to hide the childpanel when you only want to print the root panel when you pass "panelOnly" as spec argument to printPanel()
Kirvesmies
Posts: 42 Joined: Mon Dec 04, 2017 2:28 pm
Post
by Kirvesmies » Fri Jun 29, 2018 2:55 pm
Yes, but I want other opened childpanels to be printed
yavaskoray
Posts: 29 Joined: Mon Dec 02, 2013 11:15 am
Post
by yavaskoray » Wed Aug 01, 2018 8:52 am
Hi,
Is there a development regarding this issue? We would like to also print the whole UI also with the already opened child panels.
Using v3.16 Patch 1. Windows 10
Regards,
Koray
agruber
Posts: 147 Joined: Tue Sep 07, 2010 2:52 pm
Post
by agruber » Mon Aug 06, 2018 7:51 am
Hello,
What you are searching for is a screenshot function, isn´t it?
Screenshots with directly with WinCC OA do not work anymore starting from Windows 8.
You can go for a different approach, described here:
http://www.gruber.info/2018/03/use-powe ... oa-to.html
BR, Andreas
Customer Care
yavaskoray
Posts: 29 Joined: Mon Dec 02, 2013 11:15 am
Post
by yavaskoray » Mon Aug 06, 2018 8:00 am
Hello Andreas,
Thank you for the link. Yes, it is for a screenshot function. However we need to print as PDF or Hard copy from printer.
Regards,
Koray
agruber
Posts: 147 Joined: Tue Sep 07, 2010 2:52 pm
Post
by agruber » Mon Aug 06, 2018 9:25 am
Hello Koray,
In my link there was an example at the bottom, which opened the screenshot in the Windows Photo Viewer where you can print it.
In Windows 10 you can use the "Microsoft Print to PDF" printer for PDFs, but consider, there is no real benefit (at least quality wise) for a conversion to PDF.
With another system call you can also print directly:
Code: Select all
// print to specified printer with default options
system("rundll32 C:\\\\WINDOWS\\\\system32\\\\shimgvw.dll,ImageView_PrintTo " + fpath + " \\"Microsoft Print to PDF\\"");
Hope that helps.
BR, Andreas