I'm trying to create a PDF using the code below. Problem is, no matter what settings I use, the width of the resulting PDF is always the same, seems to be about 8 inches:
import pdfcrowd
import sys
try:
# create the API client instance
client = pdfcrowd.HtmlToPdfClient(
'rkarlberg', '123456789')
# configure the conversion
client.setPageWidth("200in")
client.setOrientation('landscape')
client.setNoMargins(True)
client.setJavascriptDelay(1000)
print(client.getRemainingCreditCount())
# run the conversion and write the result to a file
client.convertUrlToFile(
'https://www.mta.com/Portfolio7_User.html?user=af79ac6-433-427-b912-8af16b5433', 'Portfolios_Dec01.pdf')
except pdfcrowd.Error as why:
# report the error
sys.stderr.write('Pdfcrowd Error: {}\n'.format(why))
# handle the exception here or rethrow and handle it at a higher level
raise