Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:20:55+00:00 2026-06-07T01:20:55+00:00

The following works and will convert /tmp/file.docx to /tmp/file.pdf . libreoffice3.5. –headless –convert-to pdf

  • 0

The following works and will convert /tmp/file.docx to /tmp/file.pdf.

libreoffice3.5. --headless --convert-to pdf --outdir /tmp /tmp/file.docx

How would I convert https://www.mysite.com/getfile.php?id=123 (which will return a docx file) and save it as /tmp/file_123.pdf? I would expect it would require wget, piping, and input/output redirecting.

Thank you

EDIT – RESPONSE TO zebediah49’s Post

> libreoffice3.5 --headless --convert-to pdf --outdir /tmp <(wget -O - "http://www.mysite.com/demo/lib/m.php?cid=9&controller=detail&task=displayDocument&id=56&x=fc872c033770e3bc8706e6a90bcdff02")

--2012-07-03 14:09:03--  http://www.mysite.com/demo/lib/m.php?cid=9&controller=detail&task=displayDocument&id=56&x=fc872c033770e3bc8706e6a90bcdff02
Resolving www.mysite.com... 99.999.999.999
Connecting to www.mysite.com|99.999.999.999|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29696 (29K) [application/msword]
Saving to: `STDOUT'

     0K .......... .......... .........                       100% 14.2M=0.002s

2012-07-03 14:09:03 (14.2 MB/s) - `-' saved [29696/29696]

EDIT – RESPONSE TO rekire’s first solution

> wget http://www.mysite.com/demo/lib/m.php?cid=9&controller=detail&task=displayDocument&id=56&x=fc872c033770e3bc8706e6a90bcdff02 --no-check-certificate -O /tmp/file.docx
--2012-07-03 14:34:12--  http://www.mysite.com/demo/lib/m.php?cid=9
Resolving www.mysite.com... bash: --no-check-certificate: command not found
99.999.999.999
Connecting to www.mysite.com|99.999.999.999|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1236 (1.2K) [text/html]
Saving to: `m.php?cid=9.8'

     0K .                                                     100% 42.1M=0s

2012-07-03 14:34:12 (42.1 MB/s) - `m.php?cid=9.8' saved [1236/1236]

> libreoffice3.5 --headless --convert-to pdf --outdir /tmp /tmp/file.docx

EDIT – RESPONSE TO rekire’s second solution

> TMPFILE=`mktemp -u`
> wget http://www.mysite.com/demo/lib/m.php?cid=9&controller=detail&task=displayDocument&id=56&x=fc872c033770e3bc8706e6a90bcdff02 --no-check-certificate -O $TMPFILE
--2012-07-03 14:24:09--  http://www.mysite.com/demo/lib/m.php?cid=9
Resolving www.mysite.com... bash: --no-check-certificate: command not found
99.999.999.999
Connecting to www.mysite.com|99.999.999.999|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1236 (1.2K) [text/html]
Saving to: `m.php?cid=9.5'

     0K .                                                     100% 42.1M=0s

2012-07-03 14:24:09 (42.1 MB/s) - `m.php?cid=9.5' saved [1236/1236]


> libreoffice3.5 --headless --convert-to pdf --outdir /tmp $TMPFILE
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:20:57+00:00Added an answer on June 7, 2026 at 1:20 am

    Based on your command this two lines should work:

    wget https://www.mysite.com/getfile.php?id=123 --no-check-certificate -O /tmp/file.docx
    libreoffice3.5. --headless --convert-to pdf:outfile.pdf --outdir /tmp /tmp/file.docx
    

    Or like zebediah49 said with a unique filename:

    TMPFILE=`mktemp -u`
    wget https://www.mysite.com/getfile.php?id=123 --no-check-certificate -O $TMPFILE
    libreoffice3.5. --headless --convert-to pdf:outfile.pdf --outdir /tmp $TMPFILE
    

    Please note: The outfile will be overwritten in every run so you should use also unique names for the output file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to convert text to wave file using following function. It works
If the following works: alert( data.query.results.tbody[1].tr[0].td[0].span.img.src ); Why will this not work? var image
The following works in current Firefox (PDF loads), but not in current IE (page
I am using wkhtmltopdf to convert HTML file into PDF document on a link
In C#, it seems the following method works which will allow you to call
Wondering if following will work for google in robots.txt Disallow: /*.action I need to
Is there a reason why this query doesn't work? The following query will work
I use the following Javascript function.It will not work.It will give the Undefined Error
Please advise.. In the following code(Tested. Will work fine) public class Exp_Test { public
I know that by typing the following: :%s/iwanthis/replacedbythis/g will change all the matching words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.