You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change export output resolution to generate instruction document and pages with a specified resolution, for example low resolution for web usage, and high resolution for printing.
The idea would be to be able to change the dpi setting, and get exactly the same layout but with different quality levels. For bitmap, Portable Network Graphics and Joint Photographic Experts Group images, this would result in larger (more pixels) images as dpi is increased. For PDF, the size of page (in mm) would stay the same, but would allow to zoom in more and more as DPI (pixel density) is increased.
Environment
Version of LPub3D - 2.3.12
Operating system - All
Solution
Add pixel ratio input to the export dialogue to enable adjusting the exported DPI up or down for PDF, PNG, JPG and BMP exported content. The default ratio of 1.0 will export content at the rendered DPI. For PDF export, the document size remains constant but the 'device pixel ratio' is modified up or down; thus, the file size is also updated accordingly. For images (PNG, JPG and BMP), changing the pixel ratio results in both an updated file size and and updated image size which reflects the exported pixel DPI.
This capability enables the user to independently manage the rendered and exported DPI producing varying degrees of resolution quality.
PDF export dialogue - the rendered DPI is 150px.
PDF export completion message
150 DPI PDF with a pixel ratio of 2.0 exported at 300 DPI
PNG export dialogue
150 DPI PNG with pixel ratio of 2.0 exported at 300 DPI. A 150 DPI export is 259 KB for this sample file
A collateral behaviour of this enhancement is all exported page objects are now merged into a single page image. The reason for this is that in order to manipulate the pixel density of the PDF document, I first create an image object of each page at the specified export DPI and then write that object to the pdfWriter. This is a change from the behaviour before #304 where I directly rendered the scene to the pdfWriter so the scene's objects were individually painted. You can enable this behaviour by checking the "Use Page Image" box shown below. This setting is only shown when exporting a PDF document nd is preserved after the dialogue is closed. Furthermore, this setting is only enabled when the pixel ratio value is 1.0. A pixel ratio not equal to 1.0 will always export a single image for each page; therefore, the Use Page Image checkbox is disabled but checked as you can see in the graphic above.
Here is a graphic comparing a default exported pdf page with a single page image exported page.
Cheers,
The text was updated successfully, but these errors were encountered:
Subject
Change export output resolution to generate instruction document and pages with a specified resolution, for example low resolution for web usage, and high resolution for printing.
The idea would be to be able to change the dpi setting, and get exactly the same layout but with different quality levels. For bitmap, Portable Network Graphics and Joint Photographic Experts Group images, this would result in larger (more pixels) images as dpi is increased. For PDF, the size of page (in mm) would stay the same, but would allow to zoom in more and more as DPI (pixel density) is increased.
Environment
Version of LPub3D - 2.3.12
Operating system - All
Solution
Add pixel ratio input to the export dialogue to enable adjusting the exported DPI up or down for PDF, PNG, JPG and BMP exported content. The default ratio of 1.0 will export content at the rendered DPI. For PDF export, the document size remains constant but the 'device pixel ratio' is modified up or down; thus, the file size is also updated accordingly. For images (PNG, JPG and BMP), changing the pixel ratio results in both an updated file size and and updated image size which reflects the exported pixel DPI.
This capability enables the user to independently manage the rendered and exported DPI producing varying degrees of resolution quality.
PDF export dialogue - the rendered DPI is 150px.
PDF export completion message
150 DPI PDF with a pixel ratio of 2.0 exported at 300 DPI
PNG export dialogue
150 DPI PNG with pixel ratio of 2.0 exported at 300 DPI. A 150 DPI export is 259 KB for this sample file
A collateral behaviour of this enhancement is all exported page objects are now merged into a single page image. The reason for this is that in order to manipulate the pixel density of the PDF document, I first create an image object of each page at the specified export DPI and then write that object to the pdfWriter.
This is a change from the behaviour before #304 where I directly rendered the scene to the pdfWriter so the scene's objects were individually painted. You can enable this behaviour by checking the "Use Page Image" box shown below. This setting is only shown when exporting a PDF document nd is preserved after the dialogue is closed. Furthermore, this setting is only enabled when the pixel ratio value is 1.0. A pixel ratio not equal to 1.0 will always export a single image for each page; therefore, the Use Page Image checkbox is disabled but checked as you can see in the graphic above.Here is a graphic comparing a default exported pdf page with a single page image exported page.
Cheers,
The text was updated successfully, but these errors were encountered: