This article will briefly introduce the Canvas object. First, let me look at the constructor of Canvas.
The filename parameter controls the name of the final PDF file.
Pagesize parameter has two parameters: width and height. The default size of canvas is A4 paper (A4 for American logo letters). The specific demonstration is as follows.
Operation effect
The bottom-up parameter is used to switch coordinate systems. Some systems set the (0,0) coordinate to the bottom left. Bottom-up may be removed in the future
Page Compression Select whether to compress each page. The default page is not compressed, because compression will affect the file processing speed. If pageCompression = 1, the file will be compressed to the minimum, but the generation time will also be extended. Please note that pictures are always compressed. If you have a large number of articles and vector images, using the pageCompression parameter can effectively reduce the file size.
In version 2.0, the encoding parameter is omitted, so this parameter can be basically ignored.
Verbosity parameter parameter determines how much log information is printed. By default, the verbosity is 0. If the value is 1, you will get the log information of the generated document. The higher the value, the more log output may be generated in the future.
The encrypt parameter determines whether the document is encrypted. By default, documents are unencrypted.