Eagle negative printing - Page 1
Forum section: electronics / general

author: l3VGV
author_rank: Contributor
timestamp: November 15, 2016, 12:29:09 am
content: So i made some hobby project in eagle only to find out that in 2016 i cannot print it in negative(for photoresist dry film). Well i do not have Adobe Post script editor, or gerber viewer. But i have more than 20years of windows programming experience...How hard can it be to modify a program without source code for some feature that exist in all other similar apps. Well, its pretty simple - microsoft did everething to make it so.I made a Detours dll wich hack inside eagle process and get things right.How to use it,1) we need withdll.exe its a part of microsoft detours (express version is free and limited to x86 u can get it therehttps://www.microsoft.com/en-us/research/project/detours/)2) eaglecad_helper.dll with all the magic3) we need to use withdll.exe to load that dll into eagle process. i doing that with shortcut like thatwithdll.exe -d:eaglecad_helper.dll"e:\elec\EAGLE-7.2.0\bin\eagle2.exe"where bold part is path to your eagle executable.withdll.exe will run a new copy of eagle with dll injected and then if u print somethin it will come out in negative colors. If u need normal printing just restart eagle normaly.Work good on my laser jet 1018 and canon ink printer mg5340, and some other. Should work with any eagle version but only 32bit build.**********Here is source code, so complicated that thay can not do it without my help:Code:__declspec(dllexport) int WINAPI MyEndPage(__in HDC hdc){printInAction = 0;PatBlt ( hdc, 0, 0, GetDeviceCaps ( hdc, HORZRES ), GetDeviceCaps ( hdc, VERTRES ), DSTINVERT );return TrueEndPage(hdc);}BOOL APIENTRY DllMain( HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved){switch (ul_reason_for_call){case DLL_PROCESS_ATTACH:case DLL_THREAD_ATTACH:case DLL_THREAD_DETACH:case DLL_PROCESS_DETACH:break;}if (ul_reason_for_call == DLL_PROCESS_ATTACH){DetourRestoreAfterWith();DetourTransactionBegin();DetourUpdateThread(GetCurrentThread());DetourAttach(&(PVOID&)TrueEndPage, MyEndPage);DetourTransactionCommit();}else if (ul_reason_for_call == DLL_PROCESS_DETACH){DetourTransactionBegin();DetourUpdateThread(GetCurrentThread());DetourDetach(&(PVOID&)TrueEndPage, MyEndPage);DetourTransactionCommit();}return TRUE;}PatBlt ( hdc, 0, 0, GetDeviceCaps ( hdc, HORZRES ), GetDeviceCaps ( hdc, VERTRES ), DSTINVERT );that part is doing actual work, 1 line of code. everething else is just detour hack sturtup code...I attached compiled version and sources, u can build it with visual studio express.

author: jgarc063
author_rank: Regular Contributor
timestamp: November 15, 2016, 04:57:57 pm
content: Wow I3VGV,That is very impressive. I just wanted to let you know that in the CAM processor you can use the PS_INVERTED device in order to get inverted postscript for generating your negatives.I enjoyed reading about how you did the hack, I'm sure others will find it useful for other applications.Best Regards,Jorge GarciaAutodesk Support

author: l3VGV
author_rank: Contributor
timestamp: November 16, 2016, 10:21:36 am
content: What one do with postscript files nowdays? Is there any good and free software to view and print it? I wasnt able to find any.

author: timb
author_rank: Super Contributor
timestamp: November 16, 2016, 12:32:19 pm
content: Quote from: l3VGV on November 16, 2016, 10:21:36 amGSView/Ghostscript for viewing/printing, etc.And yes, PostScript is still widely used today. You may even use it on a daily basis and not even know it! The entire macOS/iOS display subsystem (Quartz) is based on PostScript. PDF is also based on PostScript.Fun Fact: PostScript is actually a (Turing complete) programming language.

author: technotronix
author_rank: Regular Contributor
timestamp: December 30, 2016, 07:52:31 am
content: Thanks for sharing your eagle project here. I really enjoyed.

author: richardlawson1489
author_rank: Regular Contributor
timestamp: February 01, 2017, 07:43:33 am
content: Quote from: l3VGV on November 16, 2016, 10:21:36 amLearn more on postscript from here.http://www.howtogeek.com/100016/printing-what-is-postscript/