Page 1 of 1

Add text to PDF [Error can't open file...]

Posted: Tue Mar 24, 2020 6:58 pm
by Baloon
I would like add text to pdf by command:

Code: Select all

nconvert -in pdf -text_font arial 36 -text_flag top-center -text "llll" 838.pdf
utilities returns error, is it possible add?

Re: Add text to PDF

Posted: Tue Mar 24, 2020 7:52 pm
by cday
Do you have Ghostscript installed, same x32 or x64 as the version of NConvert you are using?

It is needed I think to open the PDF, to rasterise the image, and you need to set a suitable DPI value using -dpi depending on the quality you need.

Note: The -in PDF term in your code isn't needed in practice, and you should be able to remove it, but I don't think it is likely to cause a problem.

Re: Add text to PDF

Posted: Tue Mar 24, 2020 8:02 pm
by Baloon
I installed ghostscript
message
Error: Don't know how to read this picture (838.pdf)

if delete -in pdf
message

Error: Don't know how to read this picture (838.pdf)

Re: Add text to PDF

Posted: Tue Mar 24, 2020 8:14 pm
by cday
Baloon wrote: Tue Mar 24, 2020 8:02 pm I installed ghostscript
The same x32 or x64 version as the version of NConvert you are using, whichever version of Windows you are using, presumably?

Some PDF files cannot be opened in XnView software for a currently unknown reason I think, are you able to test another PDF file?

And if you have XnView Classic or 'MP installed, with the same x32 or x64 as NConvert, could you try opening the file with one of those?

If necessary, are you able to upload the 838.pdf file, or another that doesn't open, although I'm not sure when I will be able to look at it and test your code, in case the error lies elsewhere?

[Edited]

Re: Add text to PDF

Posted: Tue Mar 24, 2020 8:39 pm
by cday
To complicate matters, I've recalled that there was actually a compatibility problem with a recent version of Ghostscript due to a change in Ghostscript, I don't have the thread immediately to hand, but if you are unable to make progress you could test a slightly older version of NConvert with an earlier version of Ghostscript...

Which versions of NConvert and Ghostscript are you currenty using?

[Edited]

Re: Add text to PDF

Posted: Thu Apr 02, 2020 8:20 am
by cday
cday wrote: Tue Mar 24, 2020 8:39 pm I've recalled that there was actually a compatibility problem with a recent version of Ghostscript due to a change in Ghostscript...
I can now confirm that NConvert 7.39 and Ghostscript 9.52 versions are compatible, so those or later versions of either should work together... :D

Use 32-bit GS with 32-bit NConvert, and 64-bit GS with 64-bit NConvert versions.