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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:34:52+00:00 2026-06-13T06:34:52+00:00

I am using wkhtmltopdf (which uses the Webkit rendering engine) to convert HTML files

  • 0

I am using wkhtmltopdf (which uses the Webkit rendering engine) to convert HTML files to PDF documents. The generated PDFs are A4. In other words, they have fixed dimensions, and thus a limited width.

One of the tables in my PDF contains images, which are intricately pieced together in a puzzle-like fashion, and which sometimes take up a lot of room.

To fit the resulting puzzle in the constraints of an A4 PDF, I am applying the CSS property -webkit-transform: scale(…);

This scales the puzzle beautifully, and it is still clearly legible, but for some reason it also pushes the table containing the puzzle to the right. It seems to be adding a significant margin to the left of the puzzle table, despite my explicitly setting its left margin to 0.

Interestingly enough, the smaller the scale in my webkit transformation, the bigger the margin on the left. So for example, if I use scale(0.75) the resulting left margin is around 200 pixels. If I use scale(0.5) the resulting left margin is around 400 pixels.

I’ve tried aligning the puzzle table to the left using absolute, fixed and relative positioning with left: 0. I’ve also tried floating it to the left, as well as sticking it in a container with text-align set to left. None of these techniques work.

Any ideas where this left margin is coming from and how I can remove it / work around it?

  • 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-13T06:34:53+00:00Added an answer on June 13, 2026 at 6:34 am

    After a bit of trial and error, adding the following CSS code to the puzzle table did the trick:

    -webkit-transform-origin-x: 0;
    

    More info on this property available here: http://css-infos.net/property/-webkit-transform-origin-x

    UPDATE: see Richar-dW’s comment below for cross-browser support.

    • 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 a html page to pdf using command-line convertor WKHTMLTOPDF.
I am using wkhtmltopdf to convert HTML file into PDF document on a link
I'm using child_process to run wkhtmltopdf to build a PDF from an html document.
I am using wkhtmltopdf to create PDF reports from HTML, I need to create
I'm currently building a class in PHP that generates PDF documents using the WKHTMLTOPDF
I'm in the middle of creating a html to pdf converter using the wkhtmltopdf
I am using wkhtmltopdf(html to pdf converter) and am running it through a php
I'm using wkhtmltopdf to export html pages to pdf, but it seems it has
I am currently using wkhtmltopdf to generate pdf files and I would like to
I'm using wkhtmltopdf on my server to transfer HTML document to PDF. It works

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.