Bug 152482 - Mail merge as documents should not show field name for empty values in PDF format
Summary: Mail merge as documents should not show field name for empty values in PDF fo...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: implementationError
: 153247 (view as bug list)
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2022-12-12 11:09 UTC by Jean-Paul
Modified: 2023-04-03 12:20 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sample data with spreadsheet, database and writer doc to reproduce the problem (16.85 KB, application/x-zip-compressed)
2022-12-12 11:12 UTC, Jean-Paul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Paul 2022-12-12 11:09:32 UTC
Description:
I am doing a mail merge, where a text should be hidden if a data field is empty. 
The output is to individual files.
The text is correctly hidden if the output file format is ODF, but it is not hidden if the output file format is PDF.

Steps to Reproduce:
1. download sample data (a zipped file with the calc spreadsheet, the writer document, and the output files).
2. open test-bug.odt and press CTL+P to print the document.
3. Answer Yes to the question : "Your document contains address database fields. Do you want to print a form letter?"
4. specify output to file, save merged document as individual documents, generate the file name from the database (field1).
5a. specify the file format as "ODF Text Document".
5b. specify the file format as "PDF - Portable Document Format".

Actual Results:
If file format is ODF Text Document (odt), the text is hidden if a data field is empty, see ccc.odt : no field2 text.
If file format is Portable Document Format (PDF), the text is not hidden if a data field is empty, see ccc.pdf : field2 text appears.

Expected Results:
If file format is Portable Document Format (PDF), the text is hidden if a data field is empty, see ccc.odt : no field2 text.


Reproducible: Always


User Profile Reset: No

Additional Info:
see sample data in attachment
Comment 1 Jean-Paul 2022-12-12 11:12:10 UTC
Created attachment 184107 [details]
sample data with spreadsheet, database and writer doc to reproduce the problem
Comment 2 Buovjaga 2023-03-13 12:11:13 UTC
Reproduced, the ccc.pdf shows

field2 :

while there is nothing in the ODT.

Bibisected with Linux 43all repo to range
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=43c7830b03d141ae11d8617c0fdabefa32dd243c..ce97851773a06103504972eb2771eecd7dd81e36

I tried grepping inside the range with queries like

git log 43c7830b03d141ae11d8617c0fdabefa32dd243c...ce97851773a06103504972eb2771eecd7dd81e36 --grep=mail

but could not find anything relevant. The range covers about 2 months.

Later there was a change that affected the output (d7e0d0135ba65243fab5ee038c21290b8e74e548)
Comment 3 Buovjaga 2023-03-13 13:14:01 UTC
(In reply to Buovjaga from comment #2)
> Later there was a change that affected the output
> (d7e0d0135ba65243fab5ee038c21290b8e74e548)

I meant the regression causing 356d93766e27337a5463e793ceeb9da757a3a37f
Comment 4 Buovjaga 2023-04-03 10:25:24 UTC
*** Bug 153247 has been marked as a duplicate of this bug. ***
Comment 5 Buovjaga 2023-04-03 10:26:11 UTC
Mike: your db04be037b611e296ef9f2542322c52ed82d7a2b made the field names be hidden by default "for any non-native documents", but apparently this does not extend to PDF.
Comment 6 Mike Kaganski 2023-04-03 11:15:17 UTC
(In reply to Buovjaga from comment #5)

This is unrelated to PDFs being "non-native" (because the output PDF is *generated*, not read). But yes, this is an implementation defect. Needs debugging and fixing. (No cycles to take it, sorry :) - please use the old "hidden paragraph" fields as a workaround, until someone fixes it.)
Comment 7 Buovjaga 2023-04-03 12:20:58 UTC
Thanks, I'll adjust the meta data