Error with PDF conversion

*** Please report new bugs here! ***

Moderators: helmut, XnTriq, xnview, Dreamer

Post Reply
User avatar
McBluna
Posts: 11
Joined: Fri Feb 26, 2010 9:38 pm
Location: Germany
Contact:

Error with PDF conversion

Post by McBluna »

Hello,

Environment:
  • Microsoft Windows Version 24H2 (Build 26120.4520)
    XnView MP 1.9.2 64-Bit
    Nconvert 7.221 64-Bit
    Ghostscript 10.05.1 for Windows (64 bit)
I'm working on Excel VBA and PDF export. After the export, I'm using the python based tool https://github.com/abarker/pdfCropMargins to crop the white area.
After reading the wiki page and installing the latest 64-Bit Ghostscript, XnView is able to create a thumbnail and show the PDF.
I've tweaked the setting for PDFDpi in xnview.ini

Code: Select all

PDFDpi=600
to get high res view.

before pdfCropMargins
Image

after pdfCropMargins
Image

this is how it looks like in XnView MP
Image

For any reason, there is an uncropped area. Also, after converting the PDF with XnView or with NConvert to PNG/WEBP.

Code: Select all

C:\Downloads>"C:\Program Files\NConvert\nconvert.exe" -rmeta -out webp -q -1 -keepfiledate -dpi 600 "PLAY Update Overview - 20250702205734.pdf"
** NCONVERT v7.221 (c) 1991-2025 Pierre-E Gougelet (Mar 28 2025/08:37:57) **
        Version for Windows 7/8/10/11 x64  (All rights reserved)
** This is freeware software (for non-commercial use)

GS: (C:\Program Files\gs\gs10.05.1\bin\gsdll64.dll)
ARG 0 -dNODISPLAY
ARG 1 -dQUIET
ARG 2 -dNOSAFER
ARG 3 -dBATCH
ARG 4 -dPDFINFO
ARG 5 PLAY Update Overview - 20250702205734.pdf
==> 84

        File has 1 page.

Title: EverSolo Update Overview
Author: McBluna
Keywords: EverSolo, Firmware, Diff Package
Creator: Microsoft« Excel« f³r Microsoft 365
Producer: Microsoft« Excel« f³r Microsoft 365 (Cropped by pdfCropMargins>=2.0.)
CreationDate: D:20250702205746+02'00'
ModDate: D:20250702205746+02'00'

Page 1 MediaBox: [63.926979 53.938286 530.394165 366.580566]    Rotate = 0      Page uses transparency features
    Fonts used:
        BCDEEE+Aptos-Bold               TrueType        Embedded        No ToUnicode
        BCDFEE+Aptos                    TrueType        Embedded        No ToUnicode


GS: (C:\Program Files\gs\gs10.05.1\bin\gsdll64.dll)
ARG 0 -dBATCH
ARG 1 -dFirstPage=1
ARG 2 -dLastPage=1
ARG 3 -dMaxBitmap=300000000
ARG 4 -sDEVICE=tiff24nc
ARG 5 -q
ARG 6 -dNOPAUSE
ARG 7 -dSAFER
ARG 8 -dTextAlphaBits=4
ARG 9 -dGraphicsAlphaBits=4
ARG 10 -g4416x3049
ARG 11 -r600x600
ARG 12 -sOutputFile=T:\TEMP\x_8D99.tmp
ARG 13 PLAY Update Overview - 20250702205734.pdf
ARG 14 -c quit
ARG 15 -c quit
==> 232
GS>Conversion of PLAY Update Overview - 20250702205734.pdf into PLAY Update Overview - 20250702205734.webp OK
I could add autocrop, but this will remove the border from the table on the image.

I've attached both PDFs, so the issue should be reproducible.
PLAY Update Overview - 20250702205734.pdf
(65.25 KiB) Downloaded 179 times
PLAY Update Overview - 20250702205453.pdf
(55.86 KiB) Downloaded 167 times
Best regards
McBluna
Image
User avatar
McBluna
Posts: 11
Joined: Fri Feb 26, 2010 9:38 pm
Location: Germany
Contact:

Re: Error with PDF conversion

Post by McBluna »

I've downgraded Ghostscript to version 9.56.1 and the behavior is different.
The white area is gone but also the top and right border.
PLAY Update Overview - 20250702222331.png
PLAY Update Overview - 20250702222331.png (269.54 KiB) Viewed 19 times
PLAY Update Overview - 20250702222331.pdf
(65.25 KiB) Downloaded 244 times
Image
Post Reply