-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Description
I'm currently using the pdf to image keyword as described in the documentation, which:
Converts pdf to image - .png format.
Args:
path (str): path to the .pdf file
save_folder (str): path to the save folder
name (str): name of the file of the image to be saved
number_page (str): page from the pdf document to be saved as image.
If value is -1, then saves all pages as separated .png files.
However, when I set page_number=-1, it does not save all pages. Instead, only the last page of the PDF is converted into a PNG file.
Environement
-
Python version:
3.11.13 -
Libraries used:
- watchui==2.0.13
- robotframework==7.3
Example Test Case
*** Settings ***
Documentation Simple PDF to image conversion test
Library WatchUI
*** Variables ***
${PDF_PATH} ./pdf_test.pdf
${IMG_NAME} image
${PAGE_NUMBER} -1
*** Test Cases ***
Convert PDF To Image
[Documentation] Convert PDF file to image format
pdf to image ${PDF_PATH} name=${IMG_NAME} page_number=${PAGE_NUMBER}Steps to reproduce :
-
Download and extract the attached ZIP file watchui-pdf.zip
-
Open a terminal and navigate into the project directory:
cd watchui-pdf -
Install required dependencies:
pip install -r requirements.txt
-
Run the Robot Framework test:
robot pdf-to-image.robot
Expected behavior
The script should generate multiple image files in the output folder:
image_1.png
image_2.png
image_3.png
...
Actual behavior
Only one image file is generated:
image.png
And it represents only the last page of the PDF.
Please let me know if I might be missing something.
Thanks for your time and for maintaining this valuable library!