Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing a file always results in "undesirable" output #408

Closed
parkdweller opened this issue Nov 14, 2018 · 8 comments
Closed

Printing a file always results in "undesirable" output #408

parkdweller opened this issue Nov 14, 2018 · 8 comments

Comments

@parkdweller
Copy link

Hi, I'm trying to print a list made in retext markdown (I'm using version 6.0.2 installed from the Debian stretch repos, but looking at the changelog, there's no mention of this issue for version 7).

When I tried to print in my laser printer, the document came out blank. Thinking there was a problem with the printer, I tried "printing" the same document as a pdf, and what I found was that the document was being printed, but with letters so light-grey that they were almost invisible:
1

Switching to webkit rendering, I tried printing it as a pdf again, and the output seems to use the same theme I'm using on the desktop (white characters on a dark background), which is very wasteful when printed on paper:
2

In other words, I can't manage to print my documents in the standard of black letters on white background. Am I missing something, or is this a bug?

@mitya57
Copy link
Member

mitya57 commented Nov 24, 2018

Thanks for your bug report.

Do you use any custom CSS or QSS?

Can you please attach your configuration file (~/.config/ReText project/ReText.conf)?

@parkdweller
Copy link
Author

parkdweller commented Nov 25, 2018

Hi @mitya57 , thanks for the reply.

I don't use any custom CSS or QSS (you're talking about the settings option to import a stylesheet file, right?)

One more thing I found out: exporting the documents as .pdf or .odt from the "export" menu option gives the same results as the ones I described before. Exporting as html, on the other hand, gives the "correct" output: black letters on white background.

Here's my ReText.conf (I removed the recent documents because I use too much profanity in the titles):

[General]
autoSave=true
livePreviewByDefault=true
recentFileList=REDACTED
saveWindowGeometry=true
windowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\0\x87\0\0\0\x36\0\0\x5\xc2\0
0\x3\xb8\0\0\0\x8d\0\0\0[\0\0\x5\xbc\0\0\x3\xb2\0\0\0\0\0\0\0\0\a\x80)

@Gawarmel
Copy link

Can verify the same problem. Installed retext on Kubuntu 18.04 with apt install retext. pdf and odt export lead to super light grey output. tried then the pip3 install. Same result. Temporarily switched back to older version of retext that used to work for years. ;-)

@qoheniac
Copy link

qoheniac commented Aug 26, 2019

Same probleme here using the vanilla ReText my distro (Fedora 30) provides.

ReText 7.0.3
PyMarkups 2.0.0
Qt 5.12.4
GNOME 3.32.2 with Adwaita-dark theme


Workaround

  1. Export HTML
  2. Open with Browser
  3. Print to file

(tried with Firefox 68.0.2 and Web 3.32.4)

@mitya57
Copy link
Member

mitya57 commented Aug 29, 2019

I have pushed a commit which should fix issues with printing and PDF export. Please test it if you can.

To test, you can just clone the repository from GitHub and start ./retext.py from there.

@qoheniac
Copy link

qoheniac commented Aug 30, 2019

Printing and PDF export now indeed work fine but now "Preview" shows nothing.

Exception occurred while parsing document:
Traceback (most recent call last):
  File "/.../retext/ReText/tab.py", line 240, in updatePreviewBox
    self.converted = self.converterProcess.get_result()
  File "/.../retext/ReText/converterprocess.py", line 175, in get_result
    raise ConversionError(result)
ReText.converterprocess.ConversionError: The background markup conversion process received this exception:
    Traceback (most recent call last):
      File "/.../retext/ReText/converterprocess.py", line 79, in _converter_process_func
        converted = current_markup.convert(job['text'])
      File "/usr/lib/python3.7/site-packages/markups/markdown.py", line 152, in convert
        self._apply_extensions()
      File "/usr/lib/python3.7/site-packages/markups/markdown.py", line 131, in _apply_extensions
        self.md = self.markdown.Markdown(extensions=extensions_final, output_format='html4')
      File "/usr/lib/python3.7/site-packages/markdown/__init__.py", line 159, in __init__
        configs=kwargs.get('extension_configs', {}))
      File "/usr/lib/python3.7/site-packages/markdown/__init__.py", line 187, in registerExtensions
        ext.extendMarkdown(self, globals())
    TypeError: extendMarkdown() takes 2 positional arguments but 3 were given

@mitya57
Copy link
Member

mitya57 commented Aug 30, 2019

@qoheniac Most probably you have Python-Markdown 2.x while the latest ReText master supports only ≥ 3.0.

Please update your Python-Markdown or revert commit 59dcfc6 in ReText.

@qoheniac
Copy link

I updated Markdown and Markups and now it works fine. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants