Source code for pecos.utils.convert_html_to_image

import logging
import os

logger = logging.getLogger(__name__)

[docs]def convert_html_to_image(html_filename, image_filename, image_format='jpg', quality=100, zoom=1): """ Convert html file to impage file using wkhtmltoimage See http://wkhtmltopdf.org/ for more information Parameters ---------- html_filename : string HTML filename with full path image_filename : string Image filename with full path image_format : string (default = 'jpg') Image format quality : int (default = 100) Image quality zoom : int (default = 1) Zoom factor """ os.system('wkhtmltoimage --format ' + image_format + ' --quality ' + str(quality) + ' --zoom ' + str(zoom) + ' ' + html_filename + ' ' + image_filename)