Callback
  • From a market stall to a store

  • -

  • From a store to a retail chain

  • -

  • From retail to manufacturing

Errors Invalid file format and Canvas does not allow drawing: how to repair a damaged print template

Volodymyr Vytyshchenko
Volodymyr Vytyshchenko

Trade automation expert at Torgsoft

Restoring Damaged Print Templates in Torgsoft: What to Do When Invalid file format and Canvas does not allow drawing Messages Appear

Every day in retail, customers are served continuously, and an integral part of this process is issuing payment documents, warranty certificates, delivery notes, and labeling goods. The document generation and printing mode in the inventory management system is required to document sales transactions, identify goods, and comply with legal requirements.

During intensive operation, entrepreneurs ask technical specialists and the sales department practical questions: why does receipt issuance stop after payment is processed, how can the standard appearance of a document be restored after changes, what should be done when system messages appear indicating that a page cannot be generated, and how can normal checkout operations be quickly restored without causing delays and queues?

Basic Concepts and Current State of the Issue

To understand the recovery procedures, it is necessary to define the key terms involved in document generation:

  • Print template — a physical file (usually with the extension .fr3, .rp1, .rp2, .rp48, etc.) stored on the computer’s hard drive that contains the document structure, visual design, and a list of variables used to output data from the database.

  • FastReport — a built-in graphical subsystem (report generator) used in the software to configure, render (draw), and print templates.

  • Program working directory — a folder on the disk (by default C:\TORGSOFT\PROGRAM\) from which the system reads template files for use.

System messages indicating that a document cannot be printed are most often related not to the sales transaction itself, but to the physical condition of the template file or the state of the Windows graphical subsystem at a particular moment.

Causes of System Messages

The two most common situations encountered by retailers have different causes and require completely different approaches to resolving them.

Situation 1. "Invalid file format" Message

This message appears immediately after an attempt to print a document (for example, after payment for a sale).

 Cause-and-effect relationship: this message means that the physical document template file has been damaged at the file system level and has become unreadable by the software. Unlike syntax errors (when a variable is specified incorrectly in the template or a bracket is missing), the "Invalid file format" message indicates that the file structure itself has been corrupted. The most common causes are a sudden power outage while the system is accessing the file, a hard drive failure (bad sectors), or incorrect saving of the file while it is being edited. In this case, the software simply cannot recognize the file as a template.

Situation 2. "Canvas does not allow drawing" Message

This system message most often appears when working with a software ECR (pECR) while a paper fiscal receipt is being generated and sent to print.

 Cause-and-effect relationship: this situation is not related to file corruption. It is caused by the way the FastReport software works when generating the graphical representation of the receipt. The subsystem cannot access the graphical interface (Canvas) to draw the page. This often occurs when working through Remote Desktop (RDP), when the screen resolution changes, or when the system temporarily lacks the required access permissions or graphical resources for rendering. It is important to know that the fiscal document itself is successfully transmitted to the tax authority, but the software may terminate unexpectedly due to a failure of the graphical module.

Step-by-Step Procedure for Restoring a Damaged Template (Invalid file format)

Step-by-step procedure for restoring a template

Since the file is physically damaged, it cannot be edited. The only solution is to replace the damaged file with an intact one. To do this, follow the procedure below:

Step 1. Back Up Current Data

Before making any changes to the file system, save its current state. Create a backup copy of the program working directory (C:\TORGSOFT\PROGRAM\) and a database archive by copying them to removable media (a USB flash drive) or to a separate folder. This will protect you from losing other individually configured templates.

Step 2. Identify the Template File

You need to determine exactly which file is used to print the problematic document. Go to Settings → Print Template Settings. Find the document in the list that causes the message (for example, "Non-Fiscal Receipt" or "Delivery Note"). The template selection field will display the exact file name (for example, Sales Receipt 56mm.fr3). Remember or write down this name.

Step 3. Replace the File with a Standard One

Since the current file is unreadable, it must be replaced with a standard intact file.

  1. Close Torgsoft on all workstations.

  2. Go to the program working directory. Find the damaged file by the name you identified in the previous step and delete it (or rename it by adding the _old suffix).

  3. Obtain an intact file. The easiest way is to download the Torgsoft demo installer from the official website, install it in a separate folder (not the working folder), and copy the standard template file with the same name from there. You can also use a file from a previous backup if it was created before the file became damaged.

  4. Paste the copied intact file into your program working directory.

Step 4. Check the Working Directory and Access Permissions

Make sure the file is located in the exact folder accessed by the software. Check whether the "Read-only" attribute is enabled for this file or directory. If the folder is write-protected, the system will not be able to work correctly with the templates. After that, launch the software and perform a test print of the document.

What to Do When the "Canvas does not allow drawing" Message Appears

What to do when "Canvas does not allow drawing" appears

Since this situation is not related to file corruption, the template does not need to be replaced. The procedure consists of restarting the graphical environment:

  1. Close the system message window.

  2. Close Torgsoft completely.

  3. If you are working through remote access (server), properly end the connection session (through the START → Sign out/Log off menu) instead of simply closing the window with the X button.

  4. Reconnect to the server and launch the software. This initializes a new graphical environment, and receipt rendering will resume.

  5. To minimize the occurrence of this situation, it is recommended to regularly update Torgsoft to the latest version, as the developers implement mechanisms to handle this behavior of the graphical subsystem.

Answers to Frequently Asked Questions from Entrepreneurs

?How can we restore the standard appearance of a receipt if we made changes and they do not work?

Torgsoft always includes standard factory templates. If you want to reset all receipt or label settings to their original state, simply clear the field containing the file name in Print Template Settings mode (or while editing the product type). An empty field instructs the system to create and use a new standard default template.

?Why did our custom receipt settings disappear after updating the software?

The software protects custom templates from being overwritten. If your template was configured and saved under a custom name in the working directory, it is not overwritten when the system is updated. However, if you edited a standard file without changing its name, it may have been updated by the system. Always save your custom templates under unique names using the "Save As..." function.

?Why is the receipt generated, but the printer feeds blank paper or stops halfway through?

Such situations indicate that the template file itself is intact, but the physical printer settings in the Windows operating system (paper format, margins) do not match the dimensions specified in the FastReport template itself. Open the printer driver settings, select the correct page size (for example, 58 mm or 80 mm), and verify that these dimensions match the page settings in the template itself.


Програма обліку товару | Торгсофт



Facebook Instagram YouTube Twitter Google News Apple Podcast SounCloud

Add comment

Add comment
Thank you for your feedback! It will be published after being reviewed by a moderator.

Related articles