Menu

#2430 Truncated Print Output on Odd Number Pages

KeePass_2.x
open
nobody
None
5
3 days ago
2026-05-27
No

Hi. Ran into the following bug when printing the KeePass database in Table format. Please fix. Thank you.

BUG DESCRIPTION:

When printing the KeePass database in Table format, all selected fields print as expected on even numbered pages. On odd numbered pages, the final field is missing. The Print Preview displays all fields.

KEEPASS INFORMATION:

Component Version/Status
KeePass 2.61.1 (x64)
KeePassLibN 2.61.1 (x64)
XSL Stylesheets for KDBX XML Installed

SYSTEM INFORMATION:

OS Name: Microsoft Windows 11 Pro
Version: 10.0.26200 Build 26200
System Manufacturer: Dell Inc.
System Model: XPS 17 9700
System Type: x64-based PC
Processor: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz, 2400 Mhz, 8 Core(s), 16 Logical P...
BIOS Version/Date: Dell Inc. 1.38.0, 1/26/2026

STEPS TO REPRODUCE:

File > Print > Layout tab

Layout > Select Tables
Fields > Deselect Notes
Fields > Select URL

This gives the following selected fields: Title, User name, Password, and URL

Style > Deselect "Colorize password characters"

Click the Print button

Sometimes I get the app's print pop-up while other times I get the System print pop-up.

Printer: Brother HL-6180DW series

Print options:

Portrait or Landscape. The problem occurs with both.

Two-sided printing. Flip on Long Edge (Portrait) or on Short Edge (Landscape).

EXPECTED RESULTS:

All fields print on all pages as shown by the Print Preview.

ACTUAL RESULTS:

On odd numbered pages, the URL field is missing. On even numbered pages the URL field prints as expected.

TEST #1:

I deselected the URL field, selected the Notes field, and re-ran the test. Same behavior. Now with a missing Notes field.

TEST #2:

I deselected the Password, URL, and Notes fields, leaving only the Title and User name fields selected.

I encountered the same problem, however, the User name field output was truncated on the odd numbered pages.

Printing Portrait layout on 8.5 x 11 inch paper, the text stopped on odd numbered pages about 3.5 inches from the right edge of the paper without the text wrapping.

The lines were all truncated on odd numbered pages even when printing only two (2) fields.

It's as if there was a 3.75 inch margin set on the right edge of the page rather than the default 0.75 inch margin.

Thank you.

Discussion

  • Paul

    Paul - 2026-05-27

    I can't reproduce this when printing to PDF. All fields are printed as expected.

    Can you print to PDF to confirm?

    cheers, Paul

     
  • wellread1

    wellread1 - 2026-05-28

    Apparently, I forgot to post this message....

    Are all your tests using two-sided printing? If so verify that the problem persists for single-sided printing. If the problem goes away it is probably a problem in the printer or page setup for duplex printing on the device.

    If the problem doesn't go away when printing single sided, try selecting 'Microsoft Print to PDF' as the printer. If the problem persists you will be able to rule out printer specific issues.

    What makes you think this is a KeePass bug rather than a printer or page setting issue? Such printer related issues are quite common for all sorts of applications, especially when duplex printing is selected.

     
  • Peter D. Ryan

    Peter D. Ryan - 2026-05-28

    TEST SCENARIOS

    In the following scenarios, I printed only the Title and URL fields using the Table layout.

    I) Hardcopy Printing

    1) Two-sided printing

    a) Portrait orientation

    On even numbered pages, everything prints as expected.

    On odd numbered pages, the right side of the print area is truncated without word wrap. The truncation occurs approximately 2.75 inches from the right edge of the physical paper. I measured it rather than eyeballing it as I did last time.

    b) Landscape orientation

    Same results as for Portrait orientation.

    2) One-sided printing

    a) Portrait orientation

    URL field is truncated on all pages. No word wrap. Please see NEW PROBLEM below.

    b) Landscape orientation

    Same results as for Portrait orientation. Please see NEW PROBLEM below.

    II) Microsoft Print to PDF

    a) Portrait orientation

    Same results as for one-sided, hardcopy printing. Please see NEW PROBLEM below.

    b) Landscape orientation

    Same results as for one-sided, hardcopy printing. Please see NEW PROBLEM below.

    NEW PROBLEM

    This new problem is in addition to the above-described truncation problems.

    This only occurs when printing one-sided.

    I) Hardcopy Printing

    1) Two-sided printing

    Does not occur.

    2) One-sided printing

    I have many groups defined in KeePass and I have arranged them alphabetically, top to bottom. The final two groups, both alphabetically and positionally, are "XPS-17" and "XPS-8700".

    a) Portrait orientation

    The final group, "XPS-8700", doesn't print at all. Not even the header prints.

    For the penultimate group, "XPS-17", the header prints. At times, that is all that prints. At other times, the upper half of the Title/URL subheader line prints.

    b) Landscape orientation

    For the final group, "XPS-8700", the group header prints as does the Title/URL subheader. No group entries print.

    For the penultimate group, "XPS-17", everything prints as expected.

    II) Microsoft Print to PDF

    a) Portrait orientation

    Same results as for one-sided, hardcopy printing.

    b) Landscape orientation

    Same results as for one-sided, hardcopy printing.

    WHY DO I THINK THIS IS A KEEPASS BUG?

    When I print more than one page of output, I always print two-sided. Paper is expensive.

    KeePass is the only app I have that exhibits this anomalous behavior. All other apps I have print fine, both one-sided and two-sided, hardcopy and .pdf

    MS Office, Notepad++, browser print functionality, etc. all work fine. It is only KeePass that has the problem.

     
  • wellread1

    wellread1 - 2026-05-28

    While I have noticed a couple of conditions that create some awkward page breaks I haven't noticed any issues related to duplex printing on my printer. I suggest you create and upload a test database, and a "Microsoft Print to PDF file" that demonstrate the key issue that you are observing.


    I don't think the issues that I have identified below are the ones you are reporting. However, I am uploading a test database, screenshots of the KeePass Layout with the settings that I believe are relevant to the awkward page breaks, and examples of print output to "Microsoft Print to PDF". They can serve as an example of one way to provide useful information we can use to address your issue.

    In both cases the awkward page breaks appear in the KeePass print view. It is not necessary to print.

    1st Case Awkward Password Page Break when nothing wraps - sensitive to font choice: When the KeePass print output containing the password field does not contain any breaking lines (each entry only requires one line) the last entry on a page may break across the page break. Generally this occurs on page 2 or later. It appears the issue can be fixed by using the same font and font size for the main and password font in Print>Layout

    2nd Case Awkward URL Page Break when URL wraps - insensitive to font choice: When the KeePass print output contains a field, (e.g. the URL field) that wraps, the last entry on a page may break across the page break. Though I haven't tested this behavior much, it doesn't appear sensitive to font choice.

    A test database PageBreakPrintTest.kdbx password: test

     
  • Peter D. Ryan

    Peter D. Ryan - 2026-05-29

    What you are requesting is a non-trivial effort.

    I will do as requested, just don't expect it any time soon.

    Question for you, please.

    What system are you using to try and replicate my reported issue?

    MS Windows? MacOS? Some flavor if UNIX?

    Thank you.

     
  • Paul

    Paul - 2026-05-29

    You could test this on a fresh copy of KeePass.

    1. Download the ZIP (portable) version.
    2. Unzip to a temporary folder.
    3. Create KeePass.config.xml in the same folder. Add the content from this post.
    4. Close KeePass.
    5. Run the temporary version and test.

    When you have finished testing, close the temporary KeePass and run your normal KeePass.

    cheers, Paul

    p.s. I am using W10.

     
  • wellread1

    wellread1 - 2026-05-29

    KeePass 2.61.1
    Printer: OKI B6300dn with OKI PCL6 Class Driver 2

    System info:
    OS Name Microsoft Windows 11 Pro
    Version 10.0.26200 Build 26200
    System Manufacturer Dell Inc.
    System Model XPS 16 9640
    System Type x64-based PC
    Processor Intel(R) Core(TM) Ultra 9 185H, 2500 Mhz, 16 Core(s), 22 Logical Processor(s)
    BIOS Version/Date Dell Inc. 1.22.0, 3/31/2026

    I don't think it should be that hard to create a test database. You may be able to use the database I have already uploaded above. If particular characteristics of KeePass entries are important you should be able to synthesize a dummy entry with the required elements. It is easy to create enough copies of the entry to output a multi-page printer job using the following procedure:

    1. Select all the entries in a group: Ctrl+A
    2. Duplicate the selected entries: Ctrl+K (uncheck all the boxes in the resultant dialog, KeePass will remember your choices.)
    3. Repeat steps 1 & 2 as many times as needed. Each iteration will double the number of entries in the database. Eight iterations will create a database containing 256 entries.

    I recommend you create a fresh KeePass test bed with default settings as described in Paul's post.

    1. Verify that your test database reproduces the issue.
    2. Upload the test database.
    3. If possible upload a copy of a print job demonstrating the problem either as a PDF from the Microsoft print to PDF driver (preferred), or as a scanned copy of output from your printer. It would be better to remove the printer as a variable.
    4. Report any non-default KeePass settings needed to reproduce the problem.

    VERY IMPORTANT Note: If you use an obfuscated real entry to create your test database make sure to delete entry histories before posting the database. You can do this using Tools>Database Tools>Database Maintenance… Set delete history entries older than (days) to zero (0) and press deleted. Then edit the sensitive entry and check the history tab to verify that you have successfully the sensitive entry(s) history. Also if you have deleted any sensitive entries during the creation of your test database, make sure to permanently delete the entries from the KeePass Recycle bin.

     

    Last edit: wellread1 2026-05-29
  • Peter D. Ryan

    Peter D. Ryan - 2026-05-29

    OK. Creating a test database to demonstrate the truncation problem was easier than I expected. I only had to create a few entries.

    This test database, however, does not demonstrate the dropped groups problem. I suspect that will necessiate the creation of enough groups and entries to cause at least one page rollover. That project is for another day.

    I've attached my test database. I renamed my original database file and had KeePass create one from scratch. The super secret master password is: password

    I removed all the groups created by default and created an Automotive group. I added several entries. Some of those entries get truncated on printing while others do not.

    I've attached two files: KP_TestDB_Portrait.pdf and KP_TestDB_Landscape.pdf

    Fairly self-explanatory, I believe.

    As you can see, the entries for American Muscle and Stage 3 Motorsports are truncated while the others are not.

    Thank you.

     
  • Paul

    Paul - 2026-05-29

    As you can see from my test print the fields wrap if they are too long for the page.
    I can't see a way to reduce the margin / turn off wrapping.

    What paper size are you using in the PDF print?

    cheers, Paul

     
  • Peter D. Ryan

    Peter D. Ryan - 2026-05-29

    Obviously, mine are not wrapping for whatever reason.

    Screenshots attached for paper size settings.

     
  • Paul

    Paul - 2026-05-29

    I also use Letter in my tests.

    Are you able to open the database on another machine?

    cheers, Paul

     
  • wellread1

    wellread1 - 2026-05-30

    Like Paul I can't reproduce your experience. See the attached output. Notably an A-B comparison of my PDF output with yours shows that the text overlaps exactly with your PDF, but the right edge of your PDF output is cut off. It seems likely that somewhere in the print "stack" the page size, right margin (and possibly bottom margin), or print area is not defined correctly. Some printers have a margin offset feature which can be useful for 2-sided printing and it could possibly account for this behavior, but this feature is by no means universal. I couldn't find such a setting in the "Microsoft Print to PDF" driver.

    Additionally the top right header, and right and left footers, if on, are cut off. The headers and footers that appear to be cut off would be on in a default KeePass installation. For some reason the top left header is in a different font in our respective PDFs.


    At this point I recommend you create a pristine test installation of the KeePass portable version in a writable folder per Paul's instructions with some additional considerations described below. This will eliminate the possibility that a corrupt or misconfiguration of settings in your KeePass config file is responsible for the issue. It will also eliminate interference from plugins (if you have any in your working installation). If the problem persists when you print from this pristine KeePass test installation, there is probably a Windows or printer specific setting causing the issue. KeePass print configuration uses the Windows Region settings (at least the units).

    If you haven't installed a pristine portable test installation of KeePass, make one per Paul's instructions. Be sure to add the keepass.config.xml file before running this installation for the first time. The particular settings in this file tells KeePass it shouldn't look for and import settings from other KeePass installations. If you aren't positive that your test installation is pristine (set to defaults), follow the instruction below to reset the KeePass settings.

    Reset KeePass settings to defaults:

    If you already have a portable test installation of KeePass or aren't positive it is set to its default state, inspect the program folder while KeePass is not running. Delete the keepass.config.xml (not keepass.exe.config) and KeePass.config.enforced.xml files if they exist. You can rename them if you want, but it is unnecessary because this is a temporary test installation. Replace the keepass.config.xml with the file Paul specified. Do not add an enforced file, KeePass will created it if and when it is needed. If you complete this reset correctly, the next time you start KeePass it will ask if you want to automatically check for updates. If this dialog does not appear, your attempt to reset Keepass has failed.

     

    Last edit: wellread1 2026-05-30
  • Peter D. Ryan

    Peter D. Ryan - 4 days ago

    Apologies for the delay in responding. Hectic weekend.

    Unfortunately, no, there is not another machine I can test this on.

    With regard to installing the portable version: will that affect my current installation of KeePass in any way?

    Thank you for all of your time and effort in looking into this issue.

     
  • wellread1

    wellread1 - 3 days ago

    KeePass installations can, and usually should be configured, to be independent of each other. If you install KeePass into a writable folder per Paul's instructions with particular attention to step 3 the portable version will be independent of the installed version. It will use the config file located in its own program directory and ignore the settings of the installed version or other portable versions. Also review my instructions on how to ensure that the test installation is using default settings.

    By default KeePass will run only one instance of KeePass at a time, i.e. Limit to single instance in Tools>Options…>Advanced[tab]>Start and Exit[section] is checked. When KeePass is first started it will run an instance of KeePass from the designated installation (depends on how KeePass is started). Once a KeePass instance is running, any attempt to start a KeePass instance from an alternate installation will be ignored, instead the running instance will be used. It is necessary to close the running instance and explicitly start KeePass from the alternate installation. Settings of the two installations won't be shared if the portable version installation is configured as previously configured. I recommend you continue using the default setting.

    It is possible to run multiple instances of KeePass from the same or different KeePass installations. To do this uncheck the aforementioned option in each KeePass installation. However allowing multiple running instances of KeePass introduces complications that can create significant confusion. Some of the issues:

    • Each time KeePass is started, a new KeePass instance is created instead of using the running instance. Hence many instances of KeePass dervied from the same or different installation can be running at any one time. It can become confusing to keep track of which instance belongs to which installation.
    • Each instance will share the settings from the KeePass installation that was used to start it. These shared settings are overwritten (not merged) when saved. The last saved settings of a instance of an installation will become the settings for that installation. Settings from independent KeePass installations remain separate if the installations are configured not to share the same settings.
    • Only one running instance from each installation can use global auto-type key that is assigned to that installation. If different installations use the same global auto-type hot key they will collide. Only the first KeePass instance that started using a particular global auto-type hot key assignment will have a working auto-type hot key no matter which installation that instance was run from.
     

    Last edit: wellread1 3 days ago
  • Paul

    Paul - 3 days ago

    Don't change the concurrency, just close the main version of KeePass and run the portable. When you have finished, close the portable and run the main.

    cheers, Paul

     

Log in to post a comment.