How to save PDF generated by chromehtml2pdf to local folder? - google-chrome

I'm using this tool to export PDF from web page. From the author's instruction
Once installed, simple command line usage is:
chromehtml2pdf --out=out.pdf https://wikipedia.org
to generate a PDF of that web page.
For local files use:
chromehtml2pdf --out=out.pdf file:///path/to/file/file.htm
Could you please explain how to use the command chromehtml2pdf --out=out.pdf file:///path/to/file/file.htm to save the PDF of https://wikipedia.org to folder 'C:\Users\Dung Le\Downloads\Documents?
Thank you so much for your help!

Oh my bad, I've just figured it out :)
chromehtml2pdf --out="E:\Trial\test.pdf" hhttps://wikipedia.org

Related

How to put a file in my website server available for download

I'm trying to implement a click and download functionality in react.
I tried using
Download
but when the user clicks on it the download would display "Failed - No file".
I searched many articles and the answer I found is
Download
So now my question is how can I upload the file to the webserver in react, so when the user goes to that url they can have a file available for download.
The file needs to be available on the webserver and if it's a public file this file needs to have Read rights set to Public. Be careful with this and not set write rights to public. How you get your file there is very dependant on your hosting provider.
I found the answer from this post: ReactJS- downloading a pdf file "Failed - no file"
I just need to put the files to download in the public folder
I use a library called: js-file-download, it helps with downloading any type of file.
Here is the link: https://www.npmjs.com/package/js-file-download
You can use below template which can generate link of file which can be downloadable.
<a href="/images/ImageName.jpg" download>
<img src="/images/ImageName.jpg" alt="Image">
</a>
You have to put the pdf file in a folder. lets assume the folder is in the main directory and the folder name is pdf-folder and the pdf filename is my-pdf.pdf,
Then you can do this:
The pdf-file
And if this doesn't work you should try implementing javascript and then use createObjectUrl.
<a href="examplefile.pdf" download > Download </a>
ref: https://www.wikihow.com/Make-a-File-Downloadable-from-Your-Website
Thank you,
Have a great day ahead !

How can I get wget to download all the pdf files from this website?

The website is: https://dgriffinchess.wordpress.com/
I already downloaded the entire website, but I'd also like to have the pdf files, and yes, I've tried this, this and this answer, and unless wget saves the pdf files other than the main site folder(the one at the Home directory), I don't see them downloading at all..(I don't wait until the command finishes, I just wait for a few minutes and see that no pdf file has been downloaded yet, and considering that there is one almost on every webpage, I conclude that the pdf's aren't getting downloaded)
I don't really care if I have to re-download the entire website again, it's not that big to begin with, what matters most to me are the .pdf files, which doesn't seem to download in any way..
Many thanks in advance
The PDF files are stored on another domain, dgriffinchess.files.wordpress.com.
To completely download this website along with the PDF files, you need to authorize the domain name where the PDF files are stored using --span-hosts and --domains=domain_a,domain_b:
wget --recursive --page-requisites --convert-links --span-hosts --domains=dgriffinchess.wordpress.com,dgriffinchess.files.wordpress.com https://dgriffinchess.wordpress.com/

IrfanView generate HTML file from Thumbnails in cmd

I try generate from IrfanView cmd interface HTML page from directory with Thumbnails, but I can't find any parameter or options, how I can do it.
I can generate Thumbnails via:
"C:\Program Files (x86)\IrfanView\i_view32.exe" "C:\Test\FullScreens\*.jpg" /resize=(100,100) /aspectratio /resample /convert="C:\Test\*.png
I can't find this in cmd:
It is possible to realize this?
Thank you, Regards,
  Peter
The text file i_options.txt in program files folder of IrfanView contains all options which can be used on command line. There is no option to create an HTML file. This must be done via GUI using the captured dialog.
But after creating the thumbnails for the images, it would be of course possible to create with a batch file also the HTML file using the commands echo, for, if and set with output created by several echo command lines redirected to the HTML file to create. Executing in a command prompt window help echo, help for, ... displays help on those internal commands of command interpreter cmd.
However, it would be a lot of work to create a batch file with all the parameters of the dialog. And it would make the batch file slower to really support all those parameters. A tailor-made batch file for creating the HTML file exactly like you want them would be much easier to code.
I suggest to try by yourself coding the batch file to create the HTML file. Create a new question with a link to this question, if you have somewhere a problem which you can't solve by yourself. Post in this question the batch code you have so far and the content of the HTML file created by IrfanView which should be instead created by the batch file.

CHM file unreadble if saved to hdd

I've just downloaded JSon.Net for framework 4.0 as a zip file.
Opening zip (using WinRar) I'm able to open Documentation.chm file by double-clicking over the name listed and the help file is well done.
Anyway if I extract this file to hdd and I open it, help is unreadable.
Sounds silly, but it's happening.
Thanks for your help!!!
EDITED:
Another tip: unreadble chm file is located in D:\.... (second NTFS partition of first hdd); if I save it on my desktop, chm file becomes readable !!! Crazy...
------------------------------------
---------- SOLUTION ----------
------------------------------------
I answer my question to close it and to help someone who finds in my same trouble.
Using tip suggested by #Marco van de Voort I searched Google for "chm unblock" and found this link:
Your CHM files are stored in the folder with '#' (hash) character in
the path Many C# developers discovered that their documentation
and e-books in CHM format cannot be read because they were storing
their CHM files in the directories like 'C:\E-books\C#\'. The hash
character signifies an anchor in HTML so the CHM viewer fails to
resolve the path properly and to retrieve the content.
That was my problem: I had path with a #... and I'd never thought this could be a great mess for CHM files!!!
Thanks to SO mates for the help given !!
Windows keeps track of downloaded files on NTFS systems, and puts certain restrictions on them. If you extract with windows explorer, this status propagates from archive to file. Using a third party tool (winrar in your case, I use INFO zip) can circumvent this.
Some descriptions and other links can be found
http://wiki.lazarus.freepascal.org/chm_backend_for_fpdoc#Troubleshooting
Free Pascal (2.4.4) has some tool to unlock them. (chmls unblock). It is done by truncating an alternate filestream (therefore it only works with NTFS). I found this info somewhere on stackoverflow, but can't quickly find the link.
It might be that virtual folders like desktop don't fully support this.
maybe the references to some content is to web or no chm file. maybe if you can disassamble in CHM editor and change paths can fix it.
maybe this can help you
There are security permissions applied to this file type by a recent patch.
you need to unblock the file:
http://www.helpscribble.com/chmnetwork.html
instead of thinking many possibilities of "windows security permission", get a CHM reader or wrap your CHM using winrar, and doubleclick to view it like you did.
It's save your time a lot!!
So, two simple solutions are:
have a CHM reader: https://blog.kowalczyk.info/articles/chm-reader-viewer-for-windows.html
OR right click CHM file/s, > Add to RAR Archive.
If you want to read it, double click RAR file > double click CHM file. BINGO!!

Swing component to open an existing file and then after viewing file save the file

I need a swing component for opening an existing CSV file in notepad or respective available viewer installed on machine and then after viewing give the capability to the user to save the file.
Appreciate your help.
Regards
Paritosh
Offer the user a JFileChooser to select the File then call Desktop.edit(File), is the easiest way to achieve that functionality.
Here it would probably load in Excel or OO.