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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:14:30+00:00 2026-05-30T22:14:30+00:00

I am using from google.appengine.api import conversion To allow me to convert an HTML

  • 0

I am using from google.appengine.api import conversion

To allow me to convert an HTML email into a PDF file. The code is below and it works.
However the width of the PDF document slices off the right hand side of my document.

Amy clues how to fix this

    asset = conversion.Asset("text/html", message.html, "test.html")
    conversion_obj = conversion.Conversion(asset, "application/pdf")
    result = conversion.convert(conversion_obj)
    if result.assets:
        for asset in result.assets:
            message.attachments=message.attachments+[(BnPresets.email_filename[0:BnPresets.email_filename.find('.')]+".pdf",asset.data)]
  • 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-30T22:14:31+00:00Added an answer on May 30, 2026 at 10:14 pm

    Unfortunately it looks like you cannot control the width (or dimensions) of converted PDF documents. Seems like you can only do this with .png images. Some extra conversion options:

    • The width of output images (*.png only)
    • A specific page or page range to output to an image (*.png only)
    • The language of source text for OCR operations (*.txt, *.html, and *.pdf only)

    Note that one way around this could be to convert your html page to a png image (with the correct width), and then re-convert this png image to a pdf document. I wouldn’t advise you to use this method because you would end up using two API calls per conversion, which gets expensive really quickly.

    A better way would be to structure the dimensions of your input html page properly such that one-off conversions to PDF documents end up being pretty much identical.

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

Sidebar

Related Questions

I am using google's appengine api from google.appengine.api import urlfetch to fetch a webpage.
I am using the api twitterizer2 downloaded from http://code.google.com/p/twitterizer/downloads/list but when I try to
I read the doc: from google.appengine.api import mail mail.send_mail(sender=support@example.com, to=Albert Johnson <Albert.Johnson@example.com>, subject=Your account
According to the Google AppEngine documentation, one should import memcache like this: from google.appengine.api
It seems that licensing terms would prevent us from using Google Maps API in
I'm using the following html to load dojo from Google's hosting. <script src=http://www.google.com/jsapi></script> <script
I am using the control library from http://code.google.com/p/gong-wpf-dragdrop/successfully for my listbox dragging operation.But there
I am using Google Apps for domain to host the email from my domain
I'm using Google Translation API to translate text from Chinese Simplified to English in
So, I figured out how to get an access token from Google using the

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.