Sign in to follow this  
Followers 0
Wombat

Need to creative minds on this...

27 posts in this topic

#1 ·  Posted (edited)

Alright, so working in IT I've come across an odd problem in a persons IE10.

So the person can print through EVERY program/file/etc on his computer EXCEPT for IE10. It throws up an error and says that IE10 has crashed. I believe its due to an update that's conflicting on his system but and tried rolling his system back, updating to latest updates, uninstalling and reinstalling IE10, IE9, IE8, and  every other thing in Internet Options possible.

Nothing works, so as a last resort, I'm hoping the brilliant minds here can help to concieve of a possible workaround with autoit. Maybe an add-on or something that makes the right click context menu's 'PRINT' option run an autoit script or an add-on that places a button in the browser... or something... But I haven't an idea of where to begin.

So any ideas?

Edited by Wombat

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites



Why not use FireFox or Chrome?

Share this post


Link to post
Share on other sites

Why not use FireFox or Chrome?

 

I said the same thing to this person, but alas there is a website that apparently uses code that is only compatible with IE or something, this was his excuse anyway and he refuses to use the other browsers.


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites

I ran into something similar once. I downloaded PDF Creator and was able to print to the PDF file... Then print the PDF on the printer...

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I ran into something similar once. I downloaded PDF Creator and was able to print to the PDF file... Then print the PDF on the printer...

8)

 

There's an idea, thanks :)


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites

Hi Wombat,

  If I understood the issue....

 I have a program at work that does not have a print function so I use this as a HOTKEY to print screenshots. 

 Irfan View is necessary for it to work.

Func _screenshotp()

    Run("i_view32.exe /capture=2")
    WinWaitActive("IrfanView")
    Send("^p")
    WinWaitActive("Print Preview")
    ControlClick("Print Preview", "", "[CLASS:Button; INSTANCE:21]");portrait
    ControlClick("Print Preview", "", "[CLASS:Button; INSTANCE:5]");custom print size
    ControlClick("Print Preview", "", "[CLASS:Button; INSTANCE:7]");aspect ratio
    GUICtrlSetState("Button7", $GUI_CHECKED)
    ControlSetText("Print Preview", "", "Edit1", "14")
    ControlSetText("Print Preview", "", "Edit2", "9.25")
    ControlClick("Print Preview", "", "[CLASS:Button; INSTANCE:14]");print
    Send("!{F4}")

EndFunc   ;==>_screenshotp

Primitive but essential, obviously you would have to change it to work on different PC.

Good Luck !

Share this post


Link to post
Share on other sites

Well, it has print in the right-click context menu, but upon selecting it IE crashes and reloads. I'm looking for a workaround to print the page. I would do a screen capture and print but it wouldn't be able to grab the entire webpage, only the visible portion.

Thank you though


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites

How about "save as" single file web archive or something and then send that to printer.

Sort of the same as the PDF idea but maybe simpler.

 

I think this direction may work, but I need to simplify it for him, I wonder if there's a way to use autoit to save a webpage as webpage complete with just a url. Maybe a small gui that asks if the person wants to print the page and upon clicking yes it grabs the current url in the address bar and saves the webpage in /temp, prints it, then deletes it from /temp.... time to research this method....


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites

There is a UDF in Example scripts, well full program, that cam get an image if a full webpage, even while not at that page, I cannot remember name of it though.

But studying it would certainly reveal how to take full page image while at it.

I think it required Aero theme, but that's all I can recall.

1 person likes this

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Perhaps driver conflict with another device on the machine.

Look in the event logs and see what's reported.

Delete all the existing printer drivers from   'printui /s /t2'

Try downloading the latest printer driver and reinstalling the printer, or switch from PS to PCL or vice versa.

Remove peripheral devices and their drivers one by one and test as you go to see if printing working.

Good luck.


 

Share this post


Link to post
Share on other sites

What happens if you just try Ctrl + P instead of trying to use the context menu ?

Share this post


Link to post
Share on other sites

sorry to be a party crusher. but i do believe the best thing would be to solve the issue.

i read you already tried that, but perhaps not as extensively or as orderly as you should.

IE version? (IE8/9 work or not? i didn't understand that from your description)

specific website issue? (other websites print?)

user profile? (other user on same ws can print from IE10? how about same user profile on another ws?)

Windows configuration? rebuild the ws according to your image standard, or step-by-step.

hardware issue (unlikely, but possible)? replace the ws

is there anything stopping you from addressing these points i have mentioned?

Share this post


Link to post
Share on other sites

Try a browser called "Avant" . It has a "rendering engine" that simulates IE or Mozila or Chrome so it cheats sites that u are using IE for example.

If printing is working with it - just set rendering to IE and advise the user to use it. Other wise - reimage the PC , i am sure the user will like that more than Avant :)

Share this post


Link to post
Share on other sites

Hi Wombat

it happens that if you are using win7 x64 there are 2 version of IE on your system, 64 and 32 bit versions, well, if this is your case, be aware that some problems arise if you run the 64 bit version in conjuction with some plugins, (i had problems with java runtime 6.xx & IE10 x64 for example).
In my case, i solved forcing the use of ie10 x32.
just make a link that points to the 32bit version instead of the 64bit.
i hope this may help.
bye

1 person likes this

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Well since this is what I do for fun....( copying (stealing) other peoples code and changing it ) I had to take a stab at this.

every printer is different so that part is not included....

#include <IE.au3>
#include <WinAPI.au3>
#include <ScreenCapture.au3>
#include <WindowsConstants.au3>
#include "AutoItObject.au3"

#cs

    Cudos to Ward for this kick-ass script; in it's entirety can be found here
    http://www.autoitscript.com/forum/topic/124002-web-screenshot/

    I have CCP'sted the stuff I needed

    Instructions : Compile and tie .exe to G-Key (additional function key) or add code for HOTKEY
    then any time you have a website you want to print, highlight the address and click the key.
    You will then have a PNG file of the website in a Dir called "temp" on your desktop

#ce
Send("^c")
$WebCap = ClipGet()

_AutoItObject_StartUp()
OnAutoItExitRegister('OnExit')

DirCreate(@DesktopDir & "\" & "temp")
WebCap($WebCap, @DesktopDir & "\" & "temp" & "\" & "webcap.png")

Func WebCap($Url, $ImageName)
    Local $hBmp = WebCapture($Url, 1280)
    _ScreenCapture_SaveImage($ImageName, $hBmp, True)
EndFunc   ;==>WebCap


Func OnExit()
    _AutoItObject_Shutdown()
EndFunc   ;==>OnExit


Func WebCapture($Url, $WebWidth = 1024)
    Local Const $DVASPECT_CONTENT = 1
    Local $tIID_IViewObject2 = _AutoItObject_CLSIDFromString("{00000127-0000-0000-C000-000000000046}")
    Local $dtagIViewObject2 = $dtagIUnknown & "Draw hresult(dword;long;ptr;ptr;dword;dword;ptr;ptr;int;dword);"
    Local $oIE = ObjCreate("Shell.Explorer.2")

    GUICreate("", $WebWidth, 768, -1, -1)
    GUICtrlCreateObj($oIE, 0, 0, $WebWidth, 768)

    _IENavigate($oIE, $Url)

    Local $oDocument = $oIE.document
    Local $oBody = $oIE.document.body
    Local $oHtml = $oIE.document.documentElement

    $oBody.scroll = "no"
    $oBody.style.borderStyle = "none"
    $oHtml.style.overflow = 'hidden'
    $oBody.style.overflow = 'hidden'

    Local $oIViewObject2 = _AutoItObject_WarpInterface($oDocument, $tIID_IViewObject2, $dtagIViewObject2)
    If @error Then Return SetError(1, 0, 0)

    Local $BodyWidth = $oBody.scrollWidth
    Local $BodyHeight = $oBody.scrollHeight
    Local $RootWidth = $oHtml.scrollWidth
    Local $RootHeight = $oHtml.scrollHeight

    Local $Width = $BodyWidth
    Local $Height = $RootHeight
    If $BodyHeight > $Height Then $Height = $BodyHeight

    $oIE.Width = $Width
    $oIE.Height = $Height

    Local $hDC = _WinAPI_GetDC(0)
    Local $hMemDC = _WinAPI_CreateCompatibleDC($hDC)
    Local $hBmp = _WinAPI_CreateCompatibleBitmap($hDC, $Width, $Height)
    _WinAPI_SelectObject($hMemDC, $hBmp)

    Local $sRECT = DllStructCreate($tagRECT)
    DllStructSetData($sRECT, "Top", 0)
    DllStructSetData($sRECT, "Left", 0)
    DllStructSetData($sRECT, "Right", $Width)
    DllStructSetData($sRECT, "Bottom", $Height)

    $oIViewObject2.Draw($DVASPECT_CONTENT, -1, 0, 0, Number($hDC), Number($hMemDC), Number(DllStructGetPtr($sRECT)), 0, 0, 0)

    _WinAPI_DeleteDC($hMemDC)
    _WinAPI_ReleaseDC(0, $hDC)
    Return $hBmp
EndFunc   ;==>WebCapture

Func _AutoItObject_WarpInterface($Obj, $IID, $Tag, $fNoUnknown = False)
    If Not IsDllStruct($IID) Then $IID = _AutoItObject_CLSIDFromString($IID)

    If Not IsObj($Obj) Then Return SetError(1, 0, 0)

    Local $pObj = _AutoItObject_IDispatchToPtr($Obj)
    If Not _AutoItObject_IUnknownAddRef($Obj) Then Return SetError(1, 0, 0)
    Local $ObjWarpped = _AutoItObject_WrapperCreate($pObj, $dtagIUnknown, $fNoUnknown)
    Local $aCall = $ObjWarpped.QueryInterface(Number(DllStructGetPtr($IID)), 0)
    If Not IsArray($aCall) And $aCall[0] <> 0 Then Return SetError(1, 0, 0)

    Local $pInterface = $aCall[2]
    Return _AutoItObject_WrapperCreate($pInterface, $Tag)
EndFunc   ;==>_AutoItObject_WarpInterface

Share this post


Link to post
Share on other sites

Just here to agree with those advising to solve, not workaround, the issue.  This would be a good candidate for a chat thread, and you could share some event logs if your company will allow.  You can always redact them, just leave what we need.

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

I guess it's a 64 bit  ie version issue and printer driver incompatibility
yes, now I seem to remember, I had a similar problem on printing

using IE 64 bit, gave printing problems
C:\Program Files\Internet Explorer\iexplore.exe        <-- IE 64bit (on win7 x64)

using IE 32 bit, printing without problems
C:\Program Files (x86)\Internet Explorer\iexplore.exe    <-- IE 32bit (also on win7 x64)

a wild guess that this is a similar case
a quick try can remove the doubt

Edited by PincoPanco

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0