Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions examples/create_pdf_thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,17 @@

convertapi.api_credentials = os.environ['API_TOKEN'] # your api token

# Example of extracting first page from PDF and then chaining conversion PDF page to JPG.
# https://www.convertapi.com/pdf-to-extract
# Example of converting the first page of a PDF to a JPG thumbnail.
# https://www.convertapi.com/pdf-to-jpg

pdf_result = convertapi.convert(
'extract',
{
'File': 'files/test.pdf',
'PageRange': 1,
}
)

jpg_result = convertapi.convert(
'jpg',
{
'File': pdf_result,
'ScaleImage': True,
'ScaleProportions': True,
'File': 'files/test.pdf',
'PageRange': 1,
'ImageHeight': 300,
'ImageWidth': 300,
'FitToSize': True,
}
)

Expand Down
Loading