The following code works well for me. I'm auto-saving information at numerous times. I'm viewing some very large graphs to save as a BMP and that way it's faster to display to the users as a BMP instead of a 15,000 datapoint graph.
The problem... Internet explorer. This is the program that is launched when saving the information. I've changed PC defaults and no joy having PDFcreator open this with a different browser, like firefox.
Can this be acomplished?
Should I try and use a different method of saving a flash embedded .aspx file to an image (doesn't matter what type)?
I'm using PDFCreator 1.4.1. Visual studio 2010. running on Server 2008 R2.
Dim fname As String, DefaultPrinter As String Dim opt As PDFCreator.clsPDFCreatorOptions
opt = _PDFCreator.cOptions With opt .UseAutosave = 1 .UseAutosaveDirectory = 1 .AutosaveDirectory = "c:\\dummy\\" .AutosaveFormat = 3 '0 is pdf '1 PNG '2 jpg '3 BMP '5 is tiff opt.AutosaveFilename = "me.bmp" End With
Dim sURL As String = "http://www.pdfforge.com" With _PDFCreator .cOptions = opt .cClearCache() Application.DoEvents() DefaultPrinter = .cDefaultPrinter .cDefaultPrinter = "PDFCreator" .cPrintURL(sURL, 9000) ReadyState = False .cPrinterStop = False End With
Timer1 = New Timer With Timer1 .Interval = CDbl(120) * 1000 .Enabled = True Do While Not ReadyState And .Enabled Application.DoEvents() Loop Application.DoEvents() .Enabled = False Application.DoEvents() .Dispose() End With
Internet explorer seems to be the default method to load a webpage and convert it. The issue is that Internet explorer is not viewing it properly, too much data and it does not like it.
Not getting rid of IE, I'm trying to get the method to use a different browser by default.
Either this or is there a different way to achieve this other than what I'm currently doing?
have you set Firefox to be the default browser? If that isn´t enough, right click on the file you want to convert and choose "open with" then choose your preferred browser and make sure the checkbox "always open filetype with the chosen application" (or similar, I´m on german Windows atm) is checked.
using another method is probably the best option. The cPrintURL calls the shell print command, maybe it is possible to change the behaviour of the shell print command by editing the registry, but it is probably more work then using a different method to do it.
I also searched for iexplore and exe within the contents of all files under C:\\\\Program Files (x86)\\\\PDFCreator\\ and could not find anything.
Can you point me in the direction of a different method of capturing a webpage, and saving it as a BMP/JPG/etc? Or a PDF and cropping that into a BMP/JPG I guess?
As I specified above ideas on how to find links as to what method of web browser is being used to launch the page, I could not find where to change it. This is in my opinion the easiest way of fixing this entire problem if you could manually launch a different browser.
i have managed to find a way to print .htmls without opening any browser, by changing the value of HKEY_CLASSES_ROOT\htmlfile\shell\Print\command to: rundll32.exe %windir%\system32\mshtml.dll,PrintHTML “%1” “%2” “%3” "%4"
I did this in a VM, always be carefull with editing registry settings.
That registry key was already setup this way, this is a server 2008 r2 without office installed. If you watch processes when you execute it, the process “iexplore.exe” comes up and goes away when completed. This is what I’m trying to avoid, the hidden iexplore.exe.
StigyBit. I have not found a solution to this problem.