In headless chrome, how do i change the default output filename? - google-chrome-headless

I am using this command to generate the screenshot
chrome --headless --disable-gpu --screenshot --window-size=1280,1696
It's generating the output in current directory with name screenshot.jpeg. I want to change the default output directory as well as output filename. Can somebody tell me the correct options I need to use?

you can specify your filename in --screenshot option.
eg.,
chrome --headless --disable-gpu --screenshot=newfilename.png https://www.chromestatus.com/

Related

Mozilla Firefox Headless Screenshot not working for local HTML files

I'm unable to generate a screenshot of a local HTML file using Firefox's (v60.9.0) headless mode
Here's the command I'm using:
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -P AJ --screenshot test.png "file:///C:/html_export.html"
I've tried with and without a profile and with different numbers of slashes after file. There are no errors in the command line - it just doesn't generate an output.
This command works fine when I substitute the file:// with an external website like:
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -P AJ --screenshot test.png google.com
Could it be related to the redirect bug mentioned here?
Any help is appreciated! Perhaps theres a way to turn on output verbosity for --headless mode?

Open chrome with cygwin

I am using a cygwin shell in windows 10. I am trying to figure out how to open chrome from the command line. I have tried typing chrome, google-chrome, chromium-browser, start chrome, open chrome, and many variations. I have even tried using my python shell, and I have also tried going to the folder where chrome.exe is located and opening it from there. The main reason I want to figure it out is because I plan to write HTML documents with python and then open them in chrome. Any ideas?
Did you try ./chrome.exe while being in the directory where the file is located? The path ./ is probably needed before the file name since the executable is not in a standard system path. You can of course also specify the full path to the file as well.
Use
cygstart "C:\path\to\chrome.exe"
or to open a specific URL,
cygstart "http://my/url.htm"

How to find the executable file for "open" command in Mac?

I would like to open many of my programs through the mac terminal, since I use that frequently. For example, I want to be able to launch "chrome" from the Mac OSx terminal by typing open chrome.
Of course, this would only work if the environmental variable path knows where to find the executable file for this program. I've tried searching for the executable file for applications (such as chrome) using this:
find . -iname "*chrome*"
but none of the results work ( and there were a lot of results, of course). So, I'm wondering what is the best way to either
1) find the executable to add to the PATH environmental variable
or
2) launch an application via some other method
Thanks.
Generally as far as I've seen, you can launch practically any application like so:
# binary file:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
# open .app:
open /Applications/Google\ Chrome.app/
# binary + variable:
appName="Google Chrome"
"/Applications/$appName.app/Contents/MacOS/$appName"
# open + variable:
appName="Google Chrome"
open "/Applications/$appName.app/"
Hope this helps! :)

Convert ODT to PDF with Openoffice on Windows

I have many .odt files in my Windows system. I would like to convert these files to PDF. I tried that in command line
soffice.bin --headless -convert-to pdf:"writer_pdf_Export" c:\MyOdtFile.odt
But, It does not work. This method can only open file, does not convert!
How can I do this?
With LibreOffice, the following command should work:
soffice.exe --headless -convert-to pdf --outdir <output directory> <file1.odt> <file2.odt>
When converting to pdf, -convert-to pdf is sufficient. The --outdir parameter is optional; if you don't use it, the PDF will be created in the current working directory. Using soffice.bin didn't work for me (missing sal3.dll), but soffice.exe works (LibreOffice 4.2.4.2, Win 7). If soffice.exe isn't in your path, you would have to set the PATH explicitly or add the complete path to the command above:
' "C:\Program Files (x86)\LibreOffice 4\program\soffice.exe" --headless -convert-to pdf --outdir C:\temp test1.odt`
Make sure that LO isn't running when issuing the convert command - otherwise the conversion will fail without an error message.
To add to #tohuwawohu's answer... he wrote:
Make sure that LO isn't running when issuing the convert command - otherwise the conversion will fail without an error message.
This can be eliminated by adding another parameter to the command line:
-env:UserInstallation=file:///tmp/LibreOffice_Conversion_${USER}"
This creates a new environment for ${USER}'s headless instance of LibreOffice, should he have already a not-headless, GUI one running.
This way, the headless instance will not conflict with the already running instance.

Bookmark Firefox iMacros located in Dropbox?

I want to share/sync my iMacros (.iim) with my colleagues.
The default folder where iMacros-files run is here:
C:\Users\Lui\Documents\iMacros\Macros
The .iim file has the following name:
#example.iim
We can bookmark a iMacro in Firefox, for fast access.
imacros://run/?m=example.iim
If #example.iim is located in the default folder the iMacro will run with no problems.
Though, would rather have some of my iMacros located within Dropbox:
C:\Users\Lui\Dropbox\Company\Tech\Tools\iMacros\Macros
According to http://wiki.imacros.net/iMacros_for_Firefox#Bookmarking %5C stands for / and %23 stands for #.
Tried to bookmark that look like this:
imacros://run/?m=C%3A%5CUsers%5CLui%5CDropbox%5CCompany%5CTech%5CTools%5CiMacros%5CMacros%5C%23example.iim
But this gives me following error:
iMacros run command: macro C:\Users\Lui\Dropbox\Company\Tech\Tools\iMacros\Macros\#example.iim not found
Anyone know if this even is possible?
Check in the options of imacros.
http://i.imgur.com/WUzce1s.png

Resources