Description: When a word document with multiple objects inserted in header section is converted to pdf, pdf file is not converted properly. The document's header section is displaying at the middle of the page. Steps to Reproduce: 1. Convert file to PDF using 'soffice --headless --nolockcheck --nodefault --nofirststartwizard --nologo --norestore --convert-to pdf --outdir /tmp /tmp/test.docx' 2. Open PDF using a viewer 3. Observe the document's header section is displaying at the middle of the page. Actual Results: Document's header section is displaying at the middle of the page. Expected Results: Should have header at its original place. Reproducible: Always User Profile Reset: No Additional Info: None
Created attachment 160833 [details] DOCX with header section
Created attachment 160834 [details] Snapshot of the pdf
Created attachment 161035 [details] DOCX compared MSO LO Wrong report for many reasons: - version cannot be 4.1 but probably 6.1 - it's not convert but fileopen problem - headless is not important, same with GUI, so shouldn't be mentioned - it's DOCX, important - fileopen was not fine but is worse since 6.1. I confirm the issue per screenshot.
Per bibisect 6.1, worse since: 1808bcf38cda75eb2e4315ec399b91e1cbb003f6 is the first bad commit commit 1808bcf38cda75eb2e4315ec399b91e1cbb003f6 Author: Jenkins Build User <tdf@pollux.tdf> Date: Sun Jan 21 23:12:18 2018 +0100 source ff8826d438a9fd080e8e61f8e66b3d3b2c8d752b Previous source e455baf19c3096f46cdcf6279590d7a59775f1fa https://gerrit.libreoffice.org/plugins/gitiles/core/+/ff8826d438a9fd080e8e61f8e66b3d3b2c8d752b%5E!/ commit ff8826d438a9fd080e8e61f8e66b3d3b2c8d752b [log] author Patrick Jaap <patrick.jaap@tu-dresden.de> Mon Jan 15 16:43:07 2018 +0100 committer Thorsten Behrens <Thorsten.Behrens@CIB.de> Sun Jan 21 22:57:54 2018 +0100 tree f695d493193406537629bc3c6558501e6debafc9 parent e455baf19c3096f46cdcf6279590d7a59775f1fa [diff] tdf#113946 add 'topMargin' to GraphicHelpers import The case '...topMargin' was not caught for setting a relative vertical position in GraphicHelpers. The test file demands a '7' here, which stands for 'PAGE_FRAME'. The '7' was overwritten in GraphicImport in case 'LN_CT_Anchor_positionV' by a call of 'resolve'. For a better overview a switch is inserted here. Change-Id: Ie98209fe445ecbba15c3dafe5980ca52421126f8 Reviewed-on: https://gerrit.libreoffice.org/47905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Created attachment 161036 [details] DOCX compared MSO LO 4.4 6.0 7.0+ There were changes in 4.4. Disregarding color improvement, there was size change, which seems worse (unless something else is better): 64c8b13f248fe7ea3808c7f8e62d0d656f170378 is the first change commit commit 64c8b13f248fe7ea3808c7f8e62d0d656f170378 Author: Matthew Francis <mjay.francis@gmail.com> Date: Sat Mar 14 21:42:08 2015 +0800 source-hash-d379d18666aa42031359ca8eb34b0021960347ae commit d379d18666aa42031359ca8eb34b0021960347ae Author: Miklos Vajna <vmiklos@collabora.co.uk> AuthorDate: Wed Jun 18 11:57:31 2014 +0200 Commit: Miklos Vajna <vmiklos@collabora.co.uk> CommitDate: Wed Jun 18 12:09:15 2014 +0200 oox: import WPS shape with text as shape with textbox This allows having real shapes (like having rounded corners) and complex content (like containing a table) at the same time. WPS shapes are wrappers around drawingML markup in DOCX files, so this only affects the DOCX import. Change-Id: Iad1c1c61233be1c17efa1821e680927aa9587215 Previous source-hash-8e67a7796f598de2f11b694542bccb48343f0d9a
The green textbox is wider because it has its width set as relative 100% to left margin - see bug #132976 about that. It is vertically centered because originally it's set to be centered relative to top margin (this seems to center it vertically inside the header), which is imported incorrectly as centered relative to "Entire page".
Created attachment 164117 [details] Simple example file with top/centered/bottom alignment of shapes relative to top margin Based on the example document in bug #103611 (but converted to DML) this file illustrates the top/centered/bottom alignment relative to the top page margin.
Created attachment 164118 [details] Screenshot of attachment #164117 [details] Version: 7.1.0.0.alpha0+ (x64) Build ID: <buildversion> CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win Locale: hu-HU (hu_HU); UI: en-US Calc: CL Current nightly from 2020-08-10 04:49:35
Szabolcs Toth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1c593e1916c9164c7db71da2017cfc26972f8e9f tdf#133045 sw: add shape alignment to the top page border It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verified in: Version: 7.1.0.0.alpha1+ (x64) Build ID: 72056f39e01e36afac36c62988331b6813c8214f CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win Locale: hu-HU (hu_HU); UI: hu-HU Calc: threaded Thanks for fixing!
Created attachment 167354 [details] DOC saved in MSO from DOCX DOC also seems fine.