trevorsandy / lpub3d

An LDraw™ editor for LEGO® style digital building instructions.
https://trevorsandy.github.io/lpub3d/
130 stars 19 forks source link

PDF generated image size differs from rendering within LPub3D and overspill the page #721

Closed d-j-m-0 closed 1 year ago

d-j-m-0 commented 1 year ago

Subject

When looking at a document within LPub3D, three images of a multi-step are shown to fit on a page. This holds true for when rendering with either the LPub3D native render or LDView.

However, when the PDF is generated, the images seem to be scaled to a larger image, meaning the expected images no longer fit on a single page.

Screen capture when using LDView to render: page_01_ldview

Screen capture when using native renderer page_01_native

The PDFs in the attached zip file for either LDView or the native renderer show the first page not fitting the three images on the first page.

Environment

Steps to reproduce

Open the model in the attached zip file. Confirm the images fit on the first page when using either renderer. Generate the PDF using either renderer. Open the corresponding PDF and examine the first page.

Expected behaviour

The images in the PDF should fit on the page in the same way they do in LPub3D.

Actual behaviour

The images in the PDF seem too big.

Workaround

None known.

avalanche_for_lpub3d_test.zip

trevorsandy commented 1 year ago

Thank you for reporting this behaviour.

I am not able to reproduce this behaviour with either a clean portable (.zip) distribution (v2.4.6 r324) or my current DevOps build.

For me, the test model file you provided is displayed the same in the editor window as it is in its PDF generated document.

PDF_Scale_01

Here is the clean portable distro LPub3D.ini config file.

LPub3D.zip

If you are also using a portable distribution and your config file is different, please provide a copy or the deltas.

If you are using an installed (.exe) distribution, you can export the registry keys at Computer\HKEY_CURRENT_USER\Software\LPub3D Software\LPub3D if you are comfortable with this action.

Cheers,

d-j-m-0 commented 1 year ago

I use the .exe distribution, so my exported registry key entry is contained in the attached zip file.

Thanks. lpubrd_resitry_export.zip

d-j-m-0 commented 1 year ago

Here's the LPub3D log file too (in the attached zip file) if it is of help. LPub3DLog.zip

d-j-m-0 commented 1 year ago

Enabled a greater level of logging. More fulsome log file in the attached zip file.

LPub3DLog.zip

d-j-m-0 commented 1 year ago

Ok, so I believe the answer is PEBCAK (problem exists between chair and keyboard) :)

In line 6 of my model file I had 0 !LPUB PAGE ORIENTATION GLOBAL LANDSCAPE but then lines 10 and 11 contained the following spurious leftovers

0 !LPUB PAGE SIZE LOCAL 8.2677 11.6929 A4 PORTRAIT
0 !LPUB PAGE ORIENTATION LOCAL LANDSCAPE

I think the combination of line 10 (telling it to use a PORTRAIT layout and then giving it a contradictory command in line 11 to use a LANDSCAPE layout weren't helpful!

Once I removed both lines 10 and 11 and allowed line 6 to do it's thing, not only did both the native renderer and LDView generated the 3 images on the first page but the generated PDF document reflected the assembly output as per LPub3D.

trevorsandy commented 1 year ago

Excellent!

Many thanks for the update.

Cheers,