Click here to Skip to main content
16,020,261 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello.

I'm a developer who needs help.

First of all, I hope you understand that the sentence structure can be strange as I ask questions using a translator machine.

I am currently working on a program that requires watermarking on any printout.

If our program is running, when printing in programs such as Notepad, Office 2016, mspaint, Adobe Reader, etc., the set watermark is printed well.

However, when printing in Chrome or Edge, the watermark is not displayed.

Currently, we are hooking GDI32.DLL and taking watermarks.

Except for IE11, Chrome, Edge, Notepad, etc. all call the hooked StartDoc function in GDI32.DLL.

I thought that Chrome or Edge would not call the function of GDI32.DLL, but when I saw the hooked function call, I knew it was not.

I think something is blocking itself when printing from Chrome or Edge.

I am curious if the above sentence is correct.


So,

If the idea of the sentence above is correct, the question is how to approach to make the watermark appear in Chrome or Edge printouts?

If even the approach is wrong, I wonder if there is another way.

I would be grateful for any help.

Thank you.

What I have tried:

I hooked the functions of GDI32.DLL to make sure it works in a normal program.
Posted
Comments
jsc42 3-Dec-20 9:33am    
I'd be very wary of hooking into standard DLLs. You cannot know how it might affect other applications and there may be issues if the DLL changes. My only thought re Chrome / Edge etc is that most browsers have a print option to not print the background of a web page. Is it possible that some of the call(s) that you are intercepting to create your watermark are for generating the web page backgrounds that the browser option is then discarding?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900