DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA - Save / Convert any given URL to a PDF File  (Read 9,445 times)

Deep-Silence

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 5
IDEA - Save / Convert any given URL to a PDF File
« on: March 14, 2010, 02:19 PM »

Hi Guys,

I am coding little around with Autohotkey myself.  :D
Recently i have been working on a program that filters the "Print-Version" of certain
articles off a website.

Some URLs containing an extension like htm, html etc. some don't. "pid=123" etc.

What i want to do is to convert these URLS to a PDF for example using the following Syntax.

Code

URL2pdf.exe "www.google.de" "C:\google.pdf"

to do this in background, too.

There are lots of solutions out there, that a private person is unable to pay for.
Thanks for any Comments... :-[

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: IDEA - Save / Convert any given URL to a PDF File
« Reply #1 on: March 14, 2010, 02:28 PM »
« Last Edit: March 14, 2010, 02:43 PM by lanux128 »

Deep-Silence

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 5
Re: IDEA - Save / Convert any given URL to a PDF File
« Reply #2 on: March 14, 2010, 02:36 PM »

Yes, i do know about this page, but i did not got it to work
to Send the URL and get back the PDF File.  :-[

Deep-Silence

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 5
Re: IDEA - Save / Convert any given URL to a PDF File
« Reply #3 on: March 14, 2010, 02:52 PM »

The thing is, i do not want to depend on
the service of a website, that might go done "in the near future", :(
so one cannot count on it to be available at any time you need it.

Thanks,

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: IDEA - Save / Convert any given URL to a PDF File
« Reply #4 on: March 14, 2010, 02:56 PM »
if you use Firefox as your browser, you can set a pdf printer like CutePDF as the default printer and use this addon to print the url - Command Line Print.

Code
firefox -print http://www.example.com/index.html

• http://sites.google.com/site/torisugari/commandlineprint2

Deep-Silence

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 5
Re: IDEA - Save / Convert any given URL to a PDF File
« Reply #5 on: March 14, 2010, 03:18 PM »
Hi lanux128,

Thanks for your suggestions,
i really appreciate them.  :Thmbsup:

i am using Opera as my browser, but perhaps i can setup a portable version,
to get it to work. Hope it can be done in the background.  :-\

Thanks

I mentioned earlier, that there are a couple of solutions on the market you need to pay for.
I would like to point to verypdf html to pdf converter commandline
to give you an impression what i am thinking about. (URL to PDF only  ;))
« Last Edit: March 14, 2010, 03:26 PM by Deep-Silence »

daddydave

  • test
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
    • Participated in NANY Challenge Once
Re: IDEA - Save / Convert any given URL to a PDF File
« Reply #6 on: April 27, 2010, 04:48 PM »
I like  lanux128's idea, here's another thought


PDF Creator has a command line option to convert a file to PDF
Quote
/IF<input-filename> /OF<output-filename>
Convert a postscript file to a PDF or bitmap. The /OF parameter must be used in conjunction with the /IF parameter. To set the output file format, include the file extension in the output file name. There is NO space between the parameters and the file names.
Examples:
pdfcreator.exe /IF"C:\description.ps" /OF"C:\description.pdf"
pdfcreator.exe /IF"C:\description.ps" /OF"C:\description.tif"

It doesn't accept a URL, though. I did see a command line url to mht converter out there if you want to be a guinea pig. (I haven't tried it). Then you might be able to do that in two lines of a batch file, the first line converting the url to mht, the second one converting the mht to pdf. There may be a better intermediary than MHT, I was just thinking of it because it preserves images.

daddydave

  • test
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
    • Participated in NANY Challenge Once
Re: IDEA - Save / Convert any given URL to a PDF File
« Reply #7 on: April 27, 2010, 07:56 PM »
Wondering if there is a command line equivalent of right clicking on a URL shortcut and hitting print and having it figure out what to do based on the what Print verb for the URL filetype says in the registry.
« Last Edit: April 27, 2010, 08:08 PM by daddydave »

Original address: https://www.donationcoder.com/forum/index.php?topic=22111.0