Summary: | PDF used as background in Draw is exported as low resolution image (but PDF inserted as image is exported as vector) | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Callegar <sergio.callegari> |
Component: | Printing and PDF export | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | aron.budea, ashodnakashian, quikee, sdc.blanco, stephane.guillou, telesto, vmiklos, vsfoote |
Priority: | medium | Keywords: | filter:pdf |
Version: | 7.3.4.2 release | ||
Hardware: | All | ||
OS: | Linux (All) | ||
See Also: |
https://bugs.documentfoundation.org/show_bug.cgi?id=115811 https://bugs.documentfoundation.org/show_bug.cgi?id=124539 |
||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 108355, 114233 |
Description
Callegar
2022-07-20 15:15:44 UTC
IMHO not a bug, rather a limitation of the pdfium based "insert as image" filter import. Something different, e.g. using the graphic objects PDF vector data rather than the raster output, would be an enhancement. Undocumented, but for 7.2 builds you *can* control the pdfium based insert filter by setting env variable: PDFIMPORT_RESOLUTION_DPI default is the 96dpi noted, but you can take the resolution as high as is needed for work on the canvas and for 7.3 was further reworked for export/printing at the higher resolution set. helpful when working at full page scaling for the image, i.e. as page background. =-ref-= [1] https://gerrit.libreoffice.org/c/core/+/113223 [2] https://gerrit.libreoffice.org/c/core/+/121087 The Wiki has info on setting env variable including PDFIMPORT_RESOLUTION_DPI, but not much about its function. @Seth? Something needed for Help, or maybe in the Draw guide or Getting started guide... If you use `insert → image` from the menu, and you insert the PDF image in the page rather than as the background of the page, then the PDF export works properly maintaining the vector nature of the image. Hence, the behavior for the background image is at best not consistent and from a user point of view it is really quite confusing why `Page → Set image as background` should use pdfium in a different way from `insert → image`. Furthermore, if you insert an SVG image as the background, then the PDF export also works properly. So again there is an inconsistency in how LibO treats two different vector formats. Because SVG support is in some cases better than PDF support (maybe in part due to the pdfium migration, that brought much more faithful conversion of PDF files to bitmaps but otherwise weakened the treatment of PDF files as a vector format) I would like to take the occasion to suggest readers who may stumble in this same issue or in other issues with PDF import to consider conversion to SVG before the import (there are many fine open source tools for that, from `dvisvgm` to `inkscape`). Is there a [META] bug for PDF image management? I see 113122. Would that be appropriate as a tracking bug for this? (In reply to Callegar from comment #3) > If you use `insert → image` from the menu, and you insert the PDF image in > the page rather than as the background of the page, then the PDF export > works properly maintaining the vector nature of the image. Hence, the > behavior for the background image is at best not consistent and from a user > point of view it is really quite confusing why `Page → Set image as > background` should use pdfium in a different way from `insert → image`. > > Furthermore, if you insert an SVG image as the background, then the PDF > export also works properly. So again there is an inconsistency in how LibO > treats two different vector formats. Reproduced as described. Right click > Page > Background > PDF results in bad bitmap resolution when exported, whereas Insert > Image > PDF keeps it as vector. Interestingly, when trying to create a sample document, I also noticed that if I insert the PDF as a page background first, and then on another page insert the same PDF as an image, I get bad resolution on _both_ in the PDF export. So to compare image insert vs page background, work on two files separately. Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 53c5d570cab036b23f4969b858a648c8f0c24f93 CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: CL threaded (In reply to Stéphane Guillou (stragu) from comment #4) And if you set the PDFIMPORT_RESOLUTION_DPI environment variable? |