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

  • Home
  • SEARCH
  • 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 6663477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:30:12+00:00 2026-05-26T02:30:12+00:00

I am trying to generate pdf using automated bash shell script, that script after

  • 0

I am trying to generate pdf using automated bash shell script, that script after every min checks the content of a file url.txt which conatins all urls line by line and i am using wkhtmltopdf for pdf generation

But the problem is pdf is not generated in the automated process but if i manually invoke that script pdf is generated. If anyone knows the solution please provide it to me?
Code of script is:

while read line;
do
wkhtmltopdf $line /var/www/images/Upload_files/name_of_file.pdf
done < /var/www/url/url.txt

  • 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-05-26T02:30:12+00:00Added an answer on May 26, 2026 at 2:30 am

    If you run it in cron then the most likely reason that it wouldn’t work is because lack of an X server. In that case one solution is to use Xvfb

    Try running your wkhtmltopdf using xvfb-run like this in a no-X environment, say, by ssh-ing to localhost and verify that the $DISPLAY environment variable is not set:

    $ xvfb-run -e /tmp/xvfb-error.log -s'-screen 0 1024x768x24' wkhtmltopdf somefile.html output.pdf
    

    If that works fine then put in in a cron job that runs every 1 minute to test whether that one liner works under cron.

    Otherwise check the /tmp/xvfb-error.log file to see if xvfb gives any error.

    It would be helpful if you can state the error message that you got when it doesn’t work

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

Sidebar

Related Questions

G'day guys, trying to build a small invoicing system (that can generate PDF's using
I'm trying to upload a PDF file to a website using Hot Banana's content
I'm trying to generate a PDF file using AJAX call in Rails3. The following
I am trying to generate pdf using Dompdf. I have the following script for
I have small web app that generate PDF files as a report. I'm trying
I am using Websupergoo's ABCpdf for ASP.NET and I am trying to generate PDF's
I am getting this exception while trying to generate a .PDF file from my
I'm trying to digitally sign a PDF file using THIS project as an example.
I am trying to generate a PDF using iTextSharp. It will consists of a
I am trying to generate a PDF using XSL(XML-FO) to transform a generated XML

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.