pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.65k stars 411 forks source link

[I] Exporting PDF (Preview) produces very small text headers #1745

Closed CharlesCage closed 4 years ago

CharlesCage commented 4 years ago

Expected behaviour

Export a markdown note to PDF (Preview) and receive a PDF that lllllooks that looks similar to the preview shown in the right-side preview pane.

Actual behaviour

In PDF (Preview) export, header text created via markdown (hash symbols) appears in a tiny font.

Steps to reproduce

  1. Navigate to a note containing markdown.
  2. Select Note->Export->Export note as PDF (Preview)
  3. Save preview to disk
  4. Open PDF

Relevant log output in the Log panel

Expand ``` [10:51:48] [warning] QPainter::begin(): Returned false ```

Information about the application, settings and environment

Expand QOwnNotes Debug Information =========================== ## General Info **Current Date**: `Thu May 14 10:51:59 2020` **Version**: `20.5.8` **Build date**: `May 13 2020` **Build number**: `5658` **Platform**: `windows` **Operating System**: `Windows 10 (10.0)` **Build architecture**: `i386` **Current architecture**: `x86_64` **Release**: `AppVeyor` **Qt Version (build)**: `5.13.2` **Qt Version (runtime)**: `5.13.2` **Portable mode**: `no` **Settings path / key**: `\HKEY_CURRENT_USER\Software\PBE\QOwnNotes` **Application database path**: `C:\Users\Chuck Cage\AppData\Roaming\PBE\QOwnNotes\QOwnNotes.sqlite` **Application arguments**: `C:\Users\Chuck Cage\Documents\qownnotes\QOwnNotes.exe` **Qt Debug**: `0` **Locale (system)**: `en_US` **Locale (interface)**: *empty* **Primary screen resolution**: `1920x1080` **Screen resolution(s)**: `1920x1080, 1920x1080, 1920x1080, 1920x1080, 1080x1920, 1080x1920` **Icon theme**: `breeze-dark-qownnotes` **Notes in current note folder**: `129` **Calendar items**: `0` **Enabled scripts**: `0` ## Server Info **serverUrl**: `https://nextcloud.chuckcage.com` **appIsValid**: `yes` **notesPathExists**: `yes` **serverVersion**: `18.0.4.2` **appVersion**: *empty* ## Spellchecking **Enabled**: `false` **Selected language**: *empty* **Language codes**: *empty* **Language names**: *empty* **Application dictionaries path**: `C:\Users\Chuck Cage\AppData\Roaming\PBE\QOwnNotes\dicts` ## Note folders **currentNoteFolderId**: `1` ### Note folder `default` **id**: `1` **isCurrent**: `yes` **activeTagId**: `-1` **localPath**: `C:\Users\Chuck Cage\Nextcloud\Notes` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `no` **activeNoteSubFolder name**: `Security and Privacy Work` **database file**: `C:\Users\Chuck Cage\Nextcloud\Notes\notes.sqlite` ## Cloud connections ### Cloud connection `Default` **id**: `1` **isCurrent**: `yes` **serverUrl**: redacted **username**: redacted ## Enabled scripts ## Settings **ActiveNoteHistoryItem** (NoteHistoryItem): `` **Debug/fakeOldVersionNumber** (QString): `false` **Debug/fileLogging** (QString): `false` **Editor/CurrentSchemaKey** (QString): `EditorColorSchema-cdbf28fc-1ddc-4d13-bb21-6a4043316a2f` **Editor/autoBracketClosing** (QString): `true` **Editor/autoBracketRemoval** (QString): `true` **Editor/disableCursorBlinking** (QString): `false` **Editor/editorWidthInDFMOnly** (QString): `true` **Editor/highlightCurrentLine** (QString): `true` **Editor/indentSize** (int): `4` **Editor/useTabIndent** (QString): `false` **Editor/vimMode** (QString): `false` **FileDialog/LastPath** (QString): `C:/Users/Chuck Cage/Downloads` **FileDialog/LastPath-NoteMarkdownExport** (QString): `C:/Users/Chuck Cage/Downloads` **FileDialog/LastPath-NotePDFExport** (QString): `C:/Users/Chuck Cage/Downloads` **FileDialog/LastPath-SettingsExport** (QString): `C:/Users/Chuck Cage/Nextcloud/CDC Home Network/Security/Network Security/Monthly/2020-05` **IssueAssistantDialog/geometry** (QByteArray): `` **LastUpdateCheck** (QDateTime): `2020-05-14T10:43:15.966` **LogWidget/criticalLog** (QString): `true` **LogWidget/debugLog** (QString): `true` **LogWidget/fatalLog** (QString): `true` **LogWidget/infoLog** (QString): `true` **LogWidget/scriptingLog** (QString): `true` **LogWidget/statusLog** (QString): `true` **LogWidget/warningLog** (QString): `true` **MainWindow/geometry** (QByteArray): `` **MainWindow/mainToolBar.iconSize** (int): `16` **MainWindow/menuBarGeometry** (QByteArray): `` **MainWindow/noteSubFolderTreeWidgetExpandState-1** (QStringList): `Clients, Clients/Overground Cloud, Personal` **MainWindow/noteTextEdit.code.font** (QString): `IBM 3270 Semi-Narrow,8,-1,5,57,0,0,0,0,0,Medium` **MainWindow/noteTextEdit.font** (QString): `Hack,8,-1,5,50,0,0,0,0,0,Regular` **MainWindow/noteTextView.code.font** (QString): `Courier New,9,-1,5,50,0,0,0,0,0,Regular` **MainWindow/noteTextView.font** (QString): `Noto Sans,12,-1,5,50,0,0,0,0,0,Regular` **MainWindow/noteTextView.ignoreCodeFontSize** (QString): `true` **MainWindow/noteTextView.rtl** (QString): `false` **MainWindow/noteTextView.underline** (QString): `true` **MainWindow/noteTextView.useEditorStyles** (QString): `false` **MainWindow/noteTextView.useInternalExportStyling** (QString): `true` **MainWindow/showNotesFromAllNoteSubFolders** (QString): `false` **NoteFolder-1/NoteTabNameList** (QStringList): `2020-05-14 Web History` **NoteFolder-1/NoteTabStickinessList** (QStringList): *empty* **NoteFolder-1/NoteTabSubFolderPathDataList** (QStringList): ``` Personal Security and Privacy Work ``` **NoteFolder-1/allowDifferentNoteFileName** (QString): `true` **NoteHistory-1** (QVariantList): `` **NoteHistoryCurrentIndex-1** (int): `199` **PiwikClientId** (QString): `` **Printer/NotePDFExportOrientation** (int): `0` **Printer/NotePDFExportPageSize** (int): `4` **ScriptRepositoryDialog/geometry** (QByteArray): `` **ScriptRepositoryDialog/mainSplitterState** (QByteArray): `` **SearchEngineId** (int): `2` **SettingsDialog/geometry** (QByteArray): `` **SettingsDialog/mainSplitterState** (QByteArray): `` **ShareDialog/geometry** (QByteArray): `` **ShowSystemTray** (QString): `false` **StartHidden** (QString): `false` **UpdateDialog/geometry** (QByteArray): `` **WelcomeDialog/geometry** (QByteArray): `` **acceptAllExternalModifications** (QString): `false` **allowNoteEditing** (QString): `true` **allowOnlyOneAppInstance** (QString): `true` **appMetrics/disableAppHeartbeat** (QString): `true` **appMetrics/disableTracking** (QString): `true` **appMetrics/notificationShown** (QString): `true` **automaticNoteFolderDatabaseClosing** (QString): `false` **checkSpelling** (QString): `false` **closeTodoListAfterSave** (QString): `false` **cryptoKey** (qlonglong): `` **currentNoteFolderId** (int): `1` **currentWorkspace** (QString): `initial` **cursorWidth** (int): `1` **customNoteFileExtensionList** (QStringList): *empty* **darkMode** (QString): `true` **darkModeColors** (QString): `true` **darkModeIconTheme** (QString): `true` **darkModeTrayIcon** (QString): `true` **defaultNoteFileExtension** (QString): `md` **demoNotesCreated** (QString): `true` **disableAutomaticUpdateDialog** (QString): `false` **disableSavedSearchesAutoCompletion** (QString): `false` **dockWasInitializedOnce** (QString): `true` **enableNoteTree** (QString): `false` **enableSocketServer** (QString): `false` **externalEditorPath** (QString): *empty* **fullyHighlightedBlockquotes** (QString): `false` **gitCommitInterval** (int): `30` **gitExecutablePath** (QString): *empty* **gitLogCommand** (QString): *empty* **guiFirstRunInit** (QString): `true` **ignoreAllExternalModifications** (QString): `false` **ignoreAllExternalNoteFolderChanges** (QString): `false` **ignoreNoteSubFolders** (QString): `^\.` **imageScaleDown** (QString): `false` **imageScaleDownMaximumHeight** (int): `1024` **imageScaleDownMaximumWidth** (int): `1024` **initialLayoutIdentifier** (QString): `full` **insertTimeFormat** (QString): *empty* **interfaceFontSize** (int): `12` **interfaceLanguage** (QString): *empty* **interfaceStyle** (QString): `Windows` **internalIconTheme** (QString): `false` **itemHeight** (int): `19` **legacyLinking** (QString): `false` **localTrash/autoCleanupDays** (int): `30` **localTrash/autoCleanupEnabled** (QString): `true` **localTrash/supportEnabled** (QString): `true` **markdownHighlightingEnabled** (QString): `true` **navigationPanelHideSearch** (QString): `false` **networking/ignoreSSLErrors** (QString): `true` **networking/proxyType** (int): `2` **newNoteAskHeadline** (QString): `true` **noteEditIsCentralWidget** (QString): `true` **noteListPreview** (QString): `false` **noteSaveIntervalTime** (int): `10` **noteSubfoldersPanelDisplayAsFullTree** (QString): `true` **noteSubfoldersPanelHideSearch** (QString): `false` **noteSubfoldersPanelOrder** (int): `0` **noteSubfoldersPanelShowFullPath** (QString): `false` **noteSubfoldersPanelShowNotesRecursively** (QString): `false` **noteSubfoldersPanelShowRootFolderName** (QString): `true` **noteSubfoldersPanelSort** (int): `0` **notesPanelOrder** (int): `0` **notesPanelSort** (int): `1` **notesPath** (QString): `C:/Users/Chuck Cage/Nextcloud/Notes` **notifyAllExternalModifications** (QString): `true` **overrideInterfaceFontSize** (QString): `true` **ownCloud/supportEnabled** (QString): `true` **ownCloud/todoCalendarBackend** (int): `3` **ownCloud/todoCalendarCalDAVPassword** (QString): `` **ownCloud/todoCalendarCalDAVServerUrl** (QString): *empty* **ownCloud/todoCalendarCalDAVUsername** (QString): *empty* **ownCloud/todoCalendarCloudConnectionId** (int): `1` **ownCloud/todoCalendarDisplayNameList** (QStringList): *empty* **ownCloud/todoCalendarEnabledList** (QStringList): *empty* **ownCloud/todoCalendarEnabledUrlList** (QStringList): *empty* **ownCloud/todoCalendarUrlList** (QStringList): *empty* **ownCloudInfo/appIsValid** (QString): `true` **ownCloudInfo/connectionErrorMessage** (QString): `Unknown error` **ownCloudInfo/notesPathExistsText** (QString): `yes` **ownCloudInfo/serverVersion** (QString): `18.0.4.2` **restoreCursorPosition** (QString): `true` **restoreLastNoteAtStartup** (QString): `true` **restoreNoteTabs** (QString): `true` **savedSearches/noteFolder-1** (QStringList): redacted **showMatches** (QString): `true` **showMenuBar** (QString): `true` **showStatusBar** (QString): `true` **systemIconTheme** (QString): `false` **tagWasAddedToNote** (QString): `true` **taggingShowNotesRecursively** (QString): `false` **tagsPanelHideSearch** (QString): `false` **tagsPanelOrder** (int): `0` **tagsPanelSort** (int): `0` **todoCalendarSupport** (QString): `false` **toolbar/1/items** (QStringList): `action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionOpen_List` **toolbar/1/name** (QString): `mainToolBar` **toolbar/1/title** (QString): `main toolbar` **toolbar/2/items** (QStringList): `actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote` **toolbar/2/name** (QString): `formattingToolbar` **toolbar/2/title** (QString): `formatting toolbar` **toolbar/3/items** (QStringList): `actionInsert_Link_to_note, actionInsert_image, actionInsert_current_time` **toolbar/3/name** (QString): `insertingToolbar` **toolbar/3/title** (QString): `inserting toolbar` **toolbar/4/items** (QStringList): `action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note` **toolbar/4/name** (QString): `encryptionToolbar` **toolbar/4/title** (QString): `encryption toolbar` **toolbar/5/items** (QStringList): `actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size` **toolbar/5/name** (QString): `windowToolbar` **toolbar/5/title** (QString): `window toolbar` **toolbar/6/items** (QStringList): `action_Quit` **toolbar/6/name** (QString): `quitToolbar` **toolbar/6/title** (QString): `quit toolbar` **toolbar/size** (int): `6` **useNoteFolderButtons** (QString): `false` **useUNIXNewline** (QString): `false` **webSocketServerService/bookmarksNoteName** (QString): `Bookmarks` **webSocketServerService/bookmarksTag** (QString): `bookmarks` **webSocketServerService/port** (int): `22222` **workspace-initial/name** (QString): `Full` **workspace-initial/noteSubFolderDockWidgetVisible** (QString): `true` **workspace-initial/windowState** (QByteArray): `` **workspaces** (QStringList): `initial` ## System environment **ALLUSERSPROFILE**: `C:\ProgramData` **APPDATA**: `C:\Users\Chuck Cage\AppData\Roaming` **CommonProgramFiles**: `C:\Program Files (x86)\Common Files` **CommonProgramFiles(x86)**: `C:\Program Files (x86)\Common Files` **CommonProgramW6432**: `C:\Program Files\Common Files` **COMPUTERNAME**: `CPS02` **ComSpec**: `C:\WINDOWS\system32\cmd.exe` **DriverData**: `C:\Windows\System32\Drivers\DriverData` **FPS_BROWSER_APP_PROFILE_STRING**: `Internet Explorer` **FPS_BROWSER_USER_PROFILE_STRING**: `Default` **HOMEDRIVE**: `C:` **HOMEPATH**: `\Users\Chuck Cage` **LOCALAPPDATA**: `C:\Users\Chuck Cage\AppData\Local` **LOGONSERVER**: `\\CPS02` **NUMBER_OF_PROCESSORS**: `8` **OneDrive**: `C:\Users\Chuck Cage\OneDrive` **OnlineServices**: `Online Services` **OS**: `Windows_NT` **Path**: `C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;C:\Program Files\010 Editor;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Vim\vim81\;C:\Program Files (x86)\Calibre2\;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files\VSCodium\bin;C:\Program Files\PuTTY\;C:\Users\Chuck Cage\scoop\shims;C:\Users\Chuck Cage\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\Chuck Cage\AppData\Local\Programs\Python\Python37\;C:\Users\Chuck Cage\AppData\Local\Microsoft\WindowsApps;C:\Program Files\sfdx\bin;C:\Program Files (x86)\Nmap;C:\Program FIles (x86)\Vim\Vim81;C:\texlive\2019\bin\win32` **PATHEXT**: `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC` **platformcode**: `KV` **PROCESSOR_ARCHITECTURE**: `x86` **PROCESSOR_ARCHITEW6432**: `AMD64` **PROCESSOR_IDENTIFIER**: `Intel64 Family 6 Model 142 Stepping 10, GenuineIntel` **PROCESSOR_LEVEL**: `6` **PROCESSOR_REVISION**: `8e0a` **ProgramData**: `C:\ProgramData` **ProgramFiles**: `C:\Program Files (x86)` **ProgramFiles(x86)**: `C:\Program Files (x86)` **ProgramW6432**: `C:\Program Files` **PSModulePath**: `C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules` **PUBLIC**: `C:\Users\Public` **QT_DEVICE_PIXEL_RATIO**: `auto` **RegionCode**: `NA` **SESSIONNAME**: `Console` **SystemDrive**: `C:` **SystemRoot**: `C:\WINDOWS` **TEMP**: `C:\Users\CHUCKC~1\AppData\Local\Temp` **TMP**: `C:\Users\CHUCKC~1\AppData\Local\Temp` **USERDOMAIN**: `CPS02` **USERDOMAIN_ROAMINGPROFILE**: `CPS02` **USERNAME**: `Chuck Cage` **USERPROFILE**: `C:\Users\Chuck Cage` **VBOX_MSI_INSTALL_PATH**: `C:\Program Files\Oracle\VirtualBox\` **windir**: `C:\WINDOWS`
CharlesCage commented 4 years ago

Here's what the PDF result looks like

Imgur

pbek commented 4 years ago

image

I cannot reproduce that. Can you please also provide the note text.

CharlesCage commented 4 years ago

Sample of note text:

2020-05-14 Web History
======================

# Video Ideas

## Information to Convey

### What information are we talking about?

* Web history
* What web pages you visit and when

### Who collects it and how?

* This data is commonly collected by Internet Service Providers (ISPs)
    * Like AT&T, Comcast, Verizon, etc.
* They collect the information from two sources
    * Domain Name Service (DNS)
CharlesCage commented 4 years ago

Created a new one with same effect so I can provide full files:

The Note MD file

The Exported PDF

What it looks like in App w/Preview

pbek commented 4 years ago

That what my PDF looks like:

image

pbek commented 4 years ago

I tried various settings but wasn't able to break my pdf export.

CharlesCage commented 4 years ago

Wow, that's exactly what I expect. Hm. Could this be a config issue? Like maybe I selected some fonts badly or something along those lines?

pbek commented 4 years ago

Can you please try again in a fresh session of QON (your old session will not be touched). See "tip" at https://docs.qownnotes.org/en/latest/getting-started/cli-parameters/

CharlesCage commented 4 years ago

Ok, did this and it looks fine when run from a clean session. I guess I must've mis-configured something. Looking for it.

Edit 1: Reset fonts to same in Interface/Editor/Preview and matched checkboxes. Still same result.

Edit 2: My Editor fonts & colors ini file export

pbek commented 4 years ago

Still same result.

What same result? A broken pdf or a correct one? Could you trace what setting broke the PDF?

CharlesCage commented 4 years ago

The broken one, sadly. :/

I haven't been able to trace the setting. I'm walking through them and trying them all. Did include my ini above in case you happen to see anything. The obvious ones (fonts/sizes) didn't change anything.

CharlesCage commented 4 years ago

Ok, so I restarted with --session temp and exported the stock light fonts and colors set to Light.ini, then diff'd it with my Dark.ini.

I have the full diff, but the only font-related entries were this:

> FontSizeAdaption_15=100
71a74
> FontSizeAdaption_8=100
108c111

But replacing it in Dark.ini and re-importing, re-starting didn't fix the issue. Still trying.

CharlesCage commented 4 years ago

I did a diff of settings exports, and all I find font-related is this:


< noteTextEdit.code.font="IBM 3270 Semi-Narrow,8,-1,5,57,0,0,0,0,0,Medium"
< noteTextEdit.font="Hack,10,-1,5,50,0,0,0,0,0,Regular"
< noteTextView.code.font="Courier New,9,-1,5,50,0,0,0,0,0,Regular"
< noteTextView.font="MS Shell Dlg 2,12,-1,5,50,0,0,0,0,0,Regular"
> noteTextEdit.code.font="Courier New,9,-1,2,50,0,0,0,0,0"
> noteTextEdit.font="MS Shell Dlg 2,12,-1,5,50,0,0,0,0,0"
> noteTextView.code.font="Courier New,9,-1,2,50,0,0,0,0,0"
> noteTextView.font="MS Shell Dlg 2,12,-1,5,50,0,0,0,0,0"
pbek commented 4 years ago

I really wonder what setting makes it break...

pbek commented 4 years ago

Any news on this issue, @CharlesCage? :grin: