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 8660019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:09:04+00:00 2026-06-12T16:09:04+00:00

I am using PHP, Mysql, jQuery. I have a webpage that is to be

  • 0

I am using PHP, Mysql, jQuery. I have a webpage that is to be converted into high-res A4 size PDF: http://optisolbusiness.com/funeral_site/sample/index/id/255.

I have converted the HTML to PDF using wkhtmltopdf, which works great.

Here is the generated PDF http://optisolbusiness.com/Guru/Gurupdf/optisol.pdf. But the HTML is not fitting exactly to PDF size; There are spaces around the HTML in PDF. How to scale HTML to fit A4 PDF size 100%? Importantly the content inside the html (ie) text size, images width and height, background images also to be scaled proportionally.

  • 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-12T16:09:06+00:00Added an answer on June 12, 2026 at 4:09 pm

    Your background image is not exactly high-res, this won’t look great in print.

    I don’t know wkhtmltopdf itself, but your body already has absolute dimensions set (in inches). This is probably the problem. Your body has a max size, the content has an absolute size too (given due to the background image pixel dimensions).

    This is not a good starting point for html-to-print transformaions, and PDF is essentially print.

    what to do (intermediate)

    • remove any size restrictions from body
    • wkhtml… has a switch called zoom, 1.5 should be an appropriate value to fill the page
    • use page-size a4

    what to do (the “right” way)

    • remove size restrictions from body
    • build the background borders (the black ones) with html elements and css styling
      • refrain from defining “width” rules for those. You will only have to define a “width” once, all other widths should be set to “auto”.
      • heights will prove troublesome, because divs are only as high as their content requires. But setting height: 100% does not respect border and margin sizes.
    • that yellow cross could be designed in css too, or a much higher resolution png/jpeg
    • Use only “real” dimensions. That means do not use pixels, use points, inches, or mm. You can use % values, but make sure those are % values of real dimensions (that means that at some point a parent element has a real dimension)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a news feed that has been developed using PHP, MySQL, and jQuery.
I am working on a filter functionality using ajax/jquery and php/mysql.I have two sets
We have a jquery/php/mysql system that allows a user to log in and review
I have a gallery of products that is dynamically created using php and mysql
Im getting a row count from Mysql using php and i have a jquery
i want to import .txt file values into mysql using php and jquery/Ajax without
I have made a chat script using php, mysql and jquery. It uses json
I have a php / mysql / jquery web app that makes 13 ajax
I am currently using PHP/MySQL and the jQuery timeago plugin. Basically, I need to
I'm building this application using PHP, MySQL and jQuery. Essentially it's a checklist management

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.