You are not logged in.

#1 2019-01-04 02:31:09

Potomac
Member
Registered: 2011-12-25
Posts: 526

[solved] Can not print text with Qt5 applications

Hello,

I notice that I can not print with kate (18.12.0-1 version) and kwrite, I get an error from cups : [CAPTFILTER] Input File Error

If I use okular then I can print without problem,
no problem also with libreoffice,

so I think there is a problem for the print feature in kate and kwrite,
my printer is an usb device "Canon LBP 3000",

Is anyone has managed to print with kate 18.12.0-1 ?

thanks

Last edited by Potomac (2019-01-09 20:55:18)

Offline

#2 2019-01-04 03:04:28

cirrus9
Member
Registered: 2016-04-15
Posts: 49

Re: [solved] Can not print text with Qt5 applications

I don't have kwrite installed, but kate 18.12.0-1 prints okay for me with a USB Samsung ML-2525W monochrome laser printer. I tested it to see after reading this post.

Offline

#3 2019-01-04 04:03:41

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

ok,

this is strange, what format of paper do you use for your printer ?
A4 format (european format), or US format ?

I think kate uses incorrect printing parameters, which trigger an error for the driver of my printer, maybe your samsung's driver is more tolerant

Last edited by Potomac (2019-01-04 04:06:55)

Offline

#4 2019-01-04 21:11:41

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

the complete error message from cups when I try to print with kate/kwrite :

[CAPTFILTER] Input File Error
paused - "ccp send_data error, exit"

it seems that kate/kwrite use improper print options compared to my printer driver (paper format, margins for example, something that triggers an error on the printer driver)

Last edited by Potomac (2019-01-04 21:51:17)

Offline

#5 2019-01-04 22:56:31

cirrus9
Member
Registered: 2016-04-15
Posts: 49

Re: [solved] Can not print text with Qt5 applications

I use the U.S. letter format for my paper when printing. However, I tried switching it to A4 as a test, and Kate prints okay with that format as well. You should look over all the settings options in both Kate, and it the printer driver set up, and see if you can find a conflict. Also, are you sure you have all your CUPS service enabled, and properly setup? Other than that I don't know what to tell you.
Maybe someone more knowledgeable that I am will post with a solution.

Offline

#6 2019-01-05 17:24:44

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

I tried all options in the print dialog box but it doesn't solve the problem,

here is a verbose log of cups when the print failed :
https://bugsfiles.kde.org/attachment.cgi?id=117299

Offline

#7 2019-01-05 18:18:42

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

I wonder if cups uses a cache  in /var/cache for each software ?
maybe there is a corrupt cache related to kate/kwrite in /var directory

Offline

#8 2019-01-05 18:31:18

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

This seems to be the only file printed as postscript rather than as pdf, can you make the kde print dialog to select pdf as backend?
Actually ghostscript warns that

This document does not conform to the Adobe Document Structuring Conventions and may not print correctly.

Offline

#9 2019-01-05 19:05:09

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

If I select "print to a file (pdf)" in the print dialog box of kate : no errors, the pdf file is created

Offline

#10 2019-01-05 19:10:27

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

You can probably print the pdf but what I meant was not to print to pdf, but print using pdf (as intermediate step) - though I don't know whether the kde print dialog lets you configure this.

Offline

#11 2019-01-05 19:16:50

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

in Kate I have 2 options :

- print with my canon LBP3000
- print to a pdf file (a pdf file will be created)

then I can open the pdf file with okular, and print to my canon printer, it can be a workaround,

I tried to read the source code of kate, but I didn't manage to find the section where the kde print dialog box is called,
source code :
https://download.kde.org/stable/applica … 2.0.tar.xz

Last edited by Potomac (2019-01-05 19:19:46)

Offline

#12 2019-01-05 20:30:50

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: [solved] Can not print text with Qt5 applications

There is no KDE print dialog. The print dialog comes from Qt and it's the same one for kate and okular, so it's quite strange that it works in one but not in the other

Offline

#13 2019-01-05 20:41:44

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

That's why I wonder if the problem could be a cache problem in cups, located in system directories (/var/cache) and which affects only kate/kwrite ?

I tried with a new user account (in order to have empty configuration files in home for plasma/kde) but the problem still exists,

other theory : an orphan archlinux package which creates a conflict (my archlinux installation date : november 2013)

Last edited by Potomac (2019-01-05 20:44:16)

Offline

#14 2019-01-05 21:34:56

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

Okular can just print the pdf. Can you btw. print the pdf you printed into before?

You could look around in /var/spool/cups whether you find the documents related to your failed print. They might hint on what the CAPTFILTER stumbles.
Can you print from some more basic Qt texteditor like https://www.archlinux.org/packages/?name=notepadqq ?

Offline

#15 2019-01-05 21:49:15

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

I tried with notepadqq : same error like kate, I can not print sad

so it could be related to Qt, for the print Qt library ?

Last edited by Potomac (2019-01-05 21:50:37)

Offline

#16 2019-01-05 21:56:42

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

Offline

#17 2019-01-05 21:59:44

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

with leafpad I can print, no problem

Last edited by Potomac (2019-01-05 21:59:51)

Offline

#18 2019-01-05 22:03:44

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

Did you compare the printlogs of leafpad and notepadqq?
Did you look at the spooler cache?

Offline

#19 2019-01-05 22:25:40

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

Here is the log for leafpad :
https://pastebin.com/t7AF3S0s

and the log for notepadqq :
https://pastebin.com/QnfE0UP0

I notice that in the log of leafpad there is no error message like " This document does not conform to the Adobe Document Structuring Conventions and may not print correctly."

How can I inspect the files present in the spooler cache ?

Offline

#20 2019-01-05 23:33:54

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

Check /var/spool/cups - there should be pdfs from your leafpad & notepadqq printing attempts (timestamps ;-)
The probably differ in the document level version or some attribute or whatnot that causes trouble down the road.

Offline

#21 2019-01-06 00:07:15

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

here are the PDF files found in the spooler cache :

https://we.tl/t-8w774bmLBz

the first file can be opened fine (print by leafpad), the second pdf file seems to have a problem (produced by notepadqq when I  click on "print" )

with leafpad the PDF version number if I check the PDF file :
%PDF-1.5

with notepadqq :
%PDF-1.4

Last edited by Potomac (2019-01-06 00:10:17)

Offline

#22 2019-01-06 02:44:04

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

I decided to install a virtual pdf printer in cups, in order to see if the bug can occur with other driver :

pacman -S cups-pdf

https://www.archlinux.org/packages/extr … /cups-pdf/

I have now a second printer in the Qt print dialog box : "Virtual_PDF_Printer", and I have a similar problem when I want to print with software based on Qt5 :

- the PDF generated displays nothing, and I have again the error "This document does not conform to the Adobe Document Structuring Conventions and may not print correctly."

and also this error :

D [06/Jan/2019:05:57:35 +0100] [Job 529] PID 32743 (gs) exited with no errors.
D [06/Jan/2019:05:57:35 +0100] [Job 529] PID 32744 (pstops) exited with no errors.
D [06/Jan/2019:05:57:35 +0100] [Job 529] PID 32741 (/usr/lib/cups/filter/pdftops) exited with no errors.
D [06/Jan/2019:05:57:35 +0100] [Job 529] GPL Ghostscript 9.26: Unrecoverable error, exit code 1

and there is a new mention when I check the status of the task :

"/var/spool/cups/d00507-001, object 6 0 at offset 446: operation for number attempted on object of type string: returning 0"

If I print from a GTK application with this virtual pdf printer : no problem, all is Ok

Last edited by Potomac (2019-01-06 05:03:45)

Offline

#23 2019-01-06 08:43:33

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

Delimiter fuckup (I'm allowed to say fuck on this forum - if appropriate ;-)

6 0 obj
<<
/Type /Page
/Parent 3 0 R
/Contents 8 0 R
/Resources 10 0 R
/Annots 11 0 R
/MediaBox [0 0 595,000000 842,000000]
>>
endobj

Is malformed, should be

6 0 obj
<<
/Type /Page
/Parent 3 0 R
/Contents 8 0 R
/Resources 10 0 R
/Annots 11 0 R
/MediaBox [0 0 595.000000 842.000000]
>>
endobj

(Notice the comma and the dot)

I'm somwhat suspecting that you can print from
LC_NUMERIC=C notepadqq

Actually I'm pretty sure - just tested ;-)

Offline

#24 2019-01-06 09:46:34

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

excellent !
yes I can print with notepadqq if I type  :

LC_NUMERIC=C notepadqq

works also for kate,

I am in France and my PC is configured with french for the region "France - français (fr_FR)" in plasma settings,

$ locale
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE=C
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

so is it really a bug in Qt5 ?

Last edited by Potomac (2019-01-06 10:06:01)

Offline

#25 2019-01-06 12:47:37

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

Yes, definitively - and "again": https://bugreports.qt.io/browse/QTBUG-24949 (this is a Qt 4.8 bug I googled up)

Offline

Board footer

Powered by FluxBB