Description: When a PDF image is used for the background of a draw document and the document is then exported as PDF, the background is included in the PDF document as a low resolution bitmap, rather than as a vector image. This is very much undesirable: - the possibility to cut/copy text is lost - the resolution is poor (96dpi) - the vector quality of the image is lost - in some cases the resulting PDF file gets larger than it could (this is limited by the very poor resolution of the bitmap, though) Note that using PDF images as background represents a frequently adopted workflow for filling in forms that have been made available in PDF, but not as PDF forms. Steps to Reproduce: 1. Open libreoffice draw 2. Insert as the background image a PDF file 3. Export to PDF 4. Open the resulting PDF file with a viewer or use some utility such as pdfimages to export the bitmaps that are present in the PDF file Actual Results: The background image is present in the PDF file as a 96dpi bitmap Expected Results: The background image should be maintained in vector format if it is in vector format to start with. Reproducible: Always User Profile Reset: No Additional Info: [Information automatically included from LibreOffice] Locale: en-US Module: StartModule [Information guessed from browser] OS: Linux (All) OS is 64bit: yes Version: 7.3.4.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 8; OS: Linux 5.18; UI render: default; VCL: kf5 (cairo+xcb) Locale: it-IT (en_US.UTF-8); UI: en-US 7.3.4-2 Calc: threaded
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?