User Manual
Go to AdmCloud
Available in All plans
Customization

HTML Printing Formats

An HTML Printing Format is your own design, written in HTML/Razor code, for printing a complete AdmCloud document (an invoice, a purchase order, a reception, a payroll action, etc.) exactly the way you want: with your logo, your colors, your tables and your text, instead of the system's standard layout. Once you create it, you assign it as the default format for that document type and AdmCloud uses it automatically every time you print it or generate its PDF.

Module: Customization Requires the "Document Printing Formats" permission

What is it and what is it for?

Every invoice, purchase order, reception, production order and dozens of other documents that AdmCloud generates have a default printing format. An HTML Printing Format lets you replace that standard layout with your own: you write HTML mixed with Razor code (for example @Model.CompanyInfo.CompanyName) that AdmCloud compiles at print time, substituting each expression with the document's real data (customer, lines, totals, taxes, your company's info, etc.).

It's different from Bank Check Printing Formats: those position loose pieces of data by coordinates on top of pre-printed check paper, while an HTML Printing Format draws the whole document (borders, tables, colors, images) from top to bottom, either to generate a PDF or to print directly as HTML (for example, on a thermal or dot-matrix printer).

The data available to use in the code (the customer's name, the document's lines, the totals, etc.) varies depending on the type of document you're formatting; each type has its own data "model", which you can explore in the Data Dictionary tab if your account has it enabled.

How to use it

  1. Create a new format. Go to HTML Printing Formats and use the New from Template menu: choose Empty to start from scratch, or pick one of the listed document types to start from a sample design already built for that document (the list only shows documents enabled on your plan and active modules).
  2. Indicate which document it applies to. In the Object field, select the document type (invoice, purchase order, reception, etc.) this format is for. This field is hidden automatically when the format is created from a Custom Record, since in that case it's already implied.
  3. Choose the output type. Turn on PDF to generate a paginated document (with margins and a header/footer repeated on every sheet), or leave it off to print directly as a single HTML page (typical for thermal or dot-matrix printers). Turning PDF on reveals the margin, header height and footer height fields.
  4. Write the document's code. On the HTML Format tab, write your HTML combined with Razor expressions (@Model.Property) to insert the document's real data. If you turned PDF on, you can also write an independent Header HTML and Footer HTML, which repeat on every sheet; inside them you can use the special variables {page} (current page), {total-pages} (total pages), {date} (print date) and {time} (print time).
  5. Check which fields are available. If your account has the Data Dictionary tab enabled, open it to see the name and type of every property of the document you're formatting, including lists (for example, an invoice's lines) and nested objects.
  6. Review the live preview. The right-hand panel renders your code with sample data inside a sandboxed frame (it never touches real data). Use the Refresh button to regenerate it from your latest edits; if your code has an error, you'll see the error message instead of the design so you can fix it.
  7. Let AI adjust the design for you (if available). Using the Modify with AI button, describe in plain language what you want to change (for example, "change the main color to blue" or "make the logo bigger") and the AI rewrites the format's code; review it in the editor before saving.
  8. Restrict who can see or edit the code, if needed. Turn on Only allow structure access to the owner so that only you (the user shown as Owner) can open, edit or view this format's code.
  9. Save the format. Using the Save button. After saving, you can go back and Edit it whenever you need to.
  10. Activate it as the default format. A new format isn't used automatically: go to Default Printing Formats (also linked from the blue notice on this screen) and select your format for the corresponding document type. From then on, AdmCloud will use it every time you print or generate that document.
ℹ️

Saving the format alone doesn't change what your users see when printing: you always have to assign it in Default Printing Formats for it to take effect.

Key capabilities

  • Free-form HTML/Razor design over the whole document (not just loose positions like Check Printing Formats).
  • Applies to dozens of document types: invoices, notes, receipts, purchase and sales orders, receptions, dispatches, inventory transfers, production orders, payroll actions, trips, service orders and requests, and more, depending on the modules active on your plan.
  • Two output modes: PDF (paginated, with its own margins and a header/footer repeated on every sheet) or HTML (a single page, ideal for thermal or dot-matrix printers).
  • Special variables {page}, {total-pages}, {date} and {time} available in the PDF mode's header and footer.
  • Instant preview with sample data, in a sandboxed frame, that refreshes just by switching the document type or clicking Refresh.
  • Built-in Data Dictionary inside the editor itself (when enabled) to check every available field without leaving the screen.
  • Modify with AI (when enabled): describe visual changes in plain language and let AI rewrite the code for you.
  • Access control by Owner, with the option to restrict editing and viewing of the code to that person only.
  • Direct creation from a Custom Record, without having to manually choose the document type.
  • Automatic security validations: the system blocks saving if the code contains instructions considered dangerous.

Key fields

Field What it's for
NameIdentifies the format in the list and when assigning it as a default format. Required and cannot be repeated.
ObjectThe document type this format applies to (invoice, purchase order, reception, etc.). Determines which sample data is used in the preview and which properties you see in the Data Dictionary.
PDFWhen on, the format generates a paginated document with its own margins and header/footer; when off, it prints as a single HTML page.
Top / Bottom / Left / Right MarginBlank space around the content in PDF mode.
Header Height / Footer HeightHeight reserved, in PDF mode, for the Header HTML and Footer HTML on each sheet.
Header HTML / Footer HTMLCode repeated at the top and bottom of every PDF sheet; supports the {page}, {total-pages}, {date} and {time} variables.
HTML FormatThe main code (HTML + Razor) that draws the document's body with the real data.
OwnerThe user responsible for the format; can transfer it or restrict its access.
Only allow structure access to the ownerWhen on, only the Owner can view or edit this format's code; other users can only use it if it's assigned as the default format.

Validations when saving

  • Name required: a format cannot be saved without a name.
  • Unique name: you cannot create a format with a name already used by another existing format.
  • Code required: the HTML Format field cannot be left empty.
  • Owner required and active: the format must have a responsible user assigned, and that user must be active in the system.
  • Protected formats: if the format has "Only allow structure access to the owner" checked, only the Owner can edit or delete it.
  • No prohibited instructions in the code: for security, the system rejects saving if the code (including AI-generated code) contains certain instructions considered dangerous or uses something formats don't allow (files, system variables, reflection), showing the element and the line.
  • Maximum time of 30 seconds: when printing or previewing, a format that takes longer (for example, because of a loop that never ends) or a function that calls itself endlessly is stopped with an error.
  • Cannot delete a format in use: if the format is assigned as the default format for a document type (at the company level or on any subsidiary), or is part of a published Plugin, the system blocks deletion until you unassign it.

Electronic invoicing: QR code and signature data

If your company issues electronic fiscal receipts (e-CF) in the Dominican Republic, every printed electronic document must show the QR code, the security code and the digital signature date required by the DGII. AdmCloud's standard formats already include them, but a custom format only shows what is written in it: if you created it from scratch, or before turning on electronic invoicing, it probably doesn't have them.

This applies to the formats of documents that are signed electronically: credit and cash invoices, promotion invoices, customer credit and debit notes, cash returns, vendor bills and receptions, expenses, and vendor credit and debit notes.

How the system warns you

  • When you create or edit a format for one of those documents and the data is missing, the warning This format doesn't include the electronic invoicing data appears above the editor. Once you add it, the warning turns green.
  • In the formats list, the ones missing the data have the No e-CF data label and are listed in a warning above the list, with a link to each one. The warning shows the first 10; if there are more, click Show all to expand the rest in a scrollable list (and Show less to collapse it again).
  • Default Printing Formats warns you about assigned formats that are missing the data.
  • When you save a format without the data, the system asks you to confirm. You can still save it, for example if that format is only used in subsidiaries that don't issue electronic receipts yet.

Add them automatically

  1. Open the format for editing.
  2. In the warning, click Add automatically. The system adds the block at the end of the document, right before </body> (after the totals and signatures), highlights the new lines in the editor and refreshes the preview.
  3. Check the preview: the sample is shown as a signed document, with a test QR code, the security code and the signature date.
  4. Click Save. If you don't like the result, click Undo in the warning before making other changes.

Add them by hand

  1. Open the Electronic invoicing tab (or click See how to add it in the warning).
  2. Click Copy and paste the block in the HTML format where you want it to appear, usually at the end, after the totals and signatures. You can also place the cursor at that spot in the code and click Insert at cursor.
  3. You can adjust the design (alignment, QR size, font), but don't remove the @if or the @Model.ElectronicInvoicing… properties.
  4. Check the preview and save the format.

This is the block:

@* Facturación electrónica (DGII): código QR, código de seguridad y fecha de firma. No borrar. *@
@if (Model.ElectronicInvoicingPrintType == AdmCommon.ElectronicInvoicingPrintTypeEnum.SIGNED_WITH_DATA_TO_PRINT_DOM)
{
    <div style="text-align: right; margin-top: 15px;">
        <img src="@Model.ElectronicInvoicingQRUrl" style="width: 100px;" alt="QR" /><br />
        <div>Código de seguridad: @Model.ElectronicInvoicingSignInformation</div>
        <div>Fecha de Firma Digital: @Model.ElectronicInvoicingSignDateTime.ToString("dd-MM-yyyy")</div>
    </div>
}
ℹ️

The block only shows on electronically signed documents. A document with a traditional fiscal receipt, or one that hasn't been signed yet, prints without it, so the same format works for both cases.

💡

If your format is a PDF and you want the QR code on every page, you can paste the block in the HTML Footer instead of the body; in that case increase the Footer Height so it fits. Usually it goes once, at the end of the body.

Availability, plan and permissions

  • Access to add, edit or delete formats is controlled by the "Document Printing Formats" permission, assignable per user or user group in Security.
  • The document types available in the Object field (and in the "New from Template" menu) depend on the modules and capabilities active on your plan; for example, Production Orders require the Manufacturing module, Trips require the Transportation module, and Employee Actions and Assets require the Payroll/HR module.
  • Creating a format for the Customer record is an add-on feature, available only if your account has it enabled (typically on the Enterprise plan).
  • The "Modify with AI" button and the "Data Dictionary" tab are features that must be enabled for your account; if you don't see them, they simply aren't turned on for your company.
  • The warning and the "Electronic invoicing" tab only appear in Dominican Republic companies with electronic invoicing turned on, in every plan that includes it (see Electronic invoicing).
  • Transferring a format to another company you administer requires the Enterprise plan with the "Create Plugins" feature active, and isn't available on evaluation companies.
  • For a format to take effect when printing, it must be assigned in Default Printing Formats.

Tips and common mistakes

💡

Always use the preview while editing: it shows you the result with sample data without affecting your real documents, so you can freely try out color, table or text changes before saving.

⚠️

Does the preview show an error message instead of the design? That's a compile error in your code: check that every @Model.Property you wrote actually exists for the selected Object (check the Data Dictionary) and that your HTML tags are properly closed.

ℹ️

Saved the format but printing still shows the old design? You still need to assign it in Default Printing Formats for the corresponding document type; saving the format by itself doesn't activate it.