Printing an UI

Find and share HowTos to various installations / configurations!
Search

Post Reply
7 posts • Page 1 of 1
Kirvesmies
Posts: 42
Joined: Mon Dec 04, 2017 2:28 pm

Printing an UI

Post by Kirvesmies »

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

User avatar
mkoller
Posts: 741
Joined: Fri Sep 17, 2010 9:03 am

Re: Printing an UI

Post by mkoller »

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

Re: Printing an UI

Post by Kirvesmies »

Yes, but I want other opened childpanels to be printed

yavaskoray
Posts: 29
Joined: Mon Dec 02, 2013 11:15 am

Re: Printing an UI

Post by yavaskoray »

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

User avatar
agruber
Posts: 147
Joined: Tue Sep 07, 2010 2:52 pm

Re: Printing an UI

Post by agruber »

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

Re: Printing an UI

Post by yavaskoray »

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

User avatar
agruber
Posts: 147
Joined: Tue Sep 07, 2010 2:52 pm

Re: Printing an UI

Post by agruber »

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

Post Reply
7 posts • Page 1 of 1