This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Without cURL…

PeterVV wrote on 2012-05-21:
Hello,

I'm using PdfCrowd in a "quite" simple way, and would like to avoid using cURL?

For instance, can you explain how to send the following sample :
$ curl -F "username=$username" -F "key=$apikey" \
> -F 'src=http://www.google.com' \
> http://pdfcrowd.com/api/pdf/convert/uri/ > google_com.pdf

without using cURL? what would be the correct URL ?

Thanks a lot

Peter

PS I'm asking this because I have difficulties running cURL under Windows, and PDFCrowd.sh dosen't seem to work under Windows… I know, using MacOS or Linux is much better (as a matter of fact, MacOSX is my development platform…) but I need to have all this work under Windows!!!
support wrote on 2012-05-22:
Peter,

I'm not aware of any alternative to curl on Windows. What exactly does not work for you? I tried the following:

1/ Downloaded curl from here: http://curl.haxx.se/gknw.net/win32/curl-7.25.0-ssl-sspi-zlib-static-bin-w32.zip
2/ Unpacked the files to c:\Program Files\curl\
3/ Created url2pdf.bat:
@echo off
set CURL="c:/Program Files/curl/curl.exe"
set USERNAME=username
set KEY=apikey
%CURL% --silent ^
       -F "src=%1" ^
       -F username=%USERNAME% ^
       -F key=%KEY% ^
       "http://pdfcrowd.com/api/pdf/convert/uri/" > "%2"

and html2pdf.bat:
@echo off
set CURL="c:/Program Files/curl/curl.exe"
set USERNAME=username
set KEY=apikey
%CURL% --silent ^
       -F "src=@%1" ^
       -F username=%USERNAME% ^
       -F key=%KEY% ^
       "http://pdfcrowd.com/api/pdf/convert/html/" > "%2"


Now I can run:
url2pdf.bat http://google.com google.pdf

which converts google.com to pdf and saves is to google.pdf. To convert a local html file I can run:
file2pdf.bat myfile.html myfile.pdf

which converts myfile.html in the current directory to myfile.pdf

Does this work for you? (Do not forget to replace username and apikey in the .bat files)