Bug 156693

Summary: IMPORT images: use image size as page size
Product: LibreOffice Reporter: SATYA SRINIVAS K <skompella>
Component: filters and storageAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: minor CC: jluth
Priority: low    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Test.png
PDF_From_Soffice.pdf
PDF_From_Adobe.pdf
Image.wmf: google suggests "unoconv Image.wmf" which uses LO to convert
Test_Emf.emf
Test_Emf_Converted_From_Adobe.pdf
Test_Emf_Exported_From_Libreoffice.pdf
Test_Emf_1_Expected.pdf

Description SATYA SRINIVAS K 2023-08-09 08:50:12 UTC
Description:
Published pdf page size is always in Letter, I think this is based on locale settings(Tools->Options->Language Settings->Languages->locale settings->Default-English(USA).)

I would like to produce PDF same as what adobe is doing, that is PDF page size same as original input image size.

Steps to Reproduce:
1.convert attached test.png to pdf using the following command
<path to soffice.exe> --convert-to pdf --outdir <my_output_directory> test.png

2.Compare the attached pdf converted from soffice.exe and with adobe.


Actual Results:
The page size is defaults to Letter/A4 based on configuration.

Expected Results:
PDF page size should be same as input image size.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Attachments:"Test.png","PDF_From_Adobe.pdf" and "PDF_From_Soffice.pdf"
Comment 1 SATYA SRINIVAS K 2023-08-09 08:50:45 UTC
Created attachment 188865 [details]
Test.png
Comment 2 SATYA SRINIVAS K 2023-08-09 08:51:06 UTC
Created attachment 188866 [details]
PDF_From_Soffice.pdf
Comment 3 SATYA SRINIVAS K 2023-08-09 08:51:24 UTC
Created attachment 188867 [details]
PDF_From_Adobe.pdf
Comment 4 Justin L 2023-08-09 15:35:06 UTC
Created attachment 188881 [details]
Image.wmf: google suggests "unoconv Image.wmf" which uses LO to convert

The real desire here is for EMF files -> PDF. Imagemagick apparently doesn't support that, so LibreOffice is the defacto converter for EMF files, which makes this bug report semi-legit. (I would not consider it legit for png etc files, since LibreOffice is not a command line image converter).
Comment 5 SATYA SRINIVAS K 2023-08-10 04:13:46 UTC
Created attachment 188891 [details]
Test_Emf.emf
Comment 6 SATYA SRINIVAS K 2023-08-10 04:14:10 UTC
Created attachment 188892 [details]
Test_Emf_Converted_From_Adobe.pdf
Comment 7 SATYA SRINIVAS K 2023-08-10 04:14:32 UTC
Created attachment 188893 [details]
Test_Emf_Exported_From_Libreoffice.pdf
Comment 8 SATYA SRINIVAS K 2023-08-22 07:29:21 UTC
Created attachment 189090 [details]
Test_Emf_1_Expected.pdf
Comment 9 Mike Kaganski 2023-08-22 08:56:43 UTC
The actual request here is completely correct, and is not related to the *conversion*, but to import:

Whenever we import any file, we must use as much information in the file, as possible. When we import DOC, we import its page sizes; when we import PDF, we also import its page size (the first, when we talk about Draw import - bug 49787).

The same must happen when we import any graphic file (PNG / SVF / EMF / ...). Whenever there is an information about the image size (for raster images, at least pixel size is always present, so may be used even in the absence of PPI info, based on "standard" pixel definition e.g. from CSS), we must not ignore it, as if we insert it into some default document.