Renderer
single page render
We are generating invoice images by passing in the json data to the animation engine. It is a good practise to often test the json and image interplay to check if everything is working correctly, for example an invoice might be missing out some rows that were intended for a particular page because the animation engine was fed in a wrong height value.
render_single_page
render_single_page (frame_number=0)
Render an invoice with a corresponding JSON object identified as frame_number
and display the PNG inline in Jupyter.
- The above function can be used like render_single_page(1) , the value we provide the function is the json object that we wish to render.
- If the dataset has 10 json objects to render the 1st object the command would be render_single_page(0) ( the indexing starts from 0,1,2 .. )
render_with_custom_data
render_with_custom_data (data_source, frame_number=0)
Render an invoice with a custom JSON data source identified as frame_number
and display the PNG inline in Jupyter.
you can use it like render_with_custom_data(“/home/ajacob/mlprojects/ocr/ocr_developer_kit/ocr_developer_kit/invoice_data.json”, 4)
Here the first argument to the method is the path of the json data, and the send argument is the integer that represents which json object is being passed in from the json data.
render_frame
render_frame ()
Render a frame by providing the json object number and the path to the json file
render_frame() can be used as it is , it is interactive in nature