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 HTML code #33

Open
jduck1987 opened this issue Oct 19, 2022 · 7 comments
Open

Printing HTML code #33

jduck1987 opened this issue Oct 19, 2022 · 7 comments

Comments

@jduck1987
Copy link

jduck1987 commented Oct 19, 2022

Some of my Menu Item Modifiers contain sizing information such as 12" or 14". But when printing with Star CloudPRNT in TastyIgniter it prints as 12" or 14". Is there anyway to print this as intended?

Print

@receiptline
Copy link
Owner

Hello!

We learned that TastyIgniter is using ReceiptLine.
Thank you very much!

Double quotes in ReceiptLine are written as \" or \x22.

|1 - PIZZA - All Meats
|~~- 14\" 12\x22 Large
|~~- Hand Tossed

quote

Best regards.

@jduck1987
Copy link
Author

The issue isn't escaping a character, it's how TastyIgniter passes the data to ReceiptLine. The code used in TastyIgniter to render the mentioned section of the receipt is:

@if ($menu['menu_options']) @foreach ($menu['menu_options'] as $group_name => $menu_options) @foreach ($menu_options as $menu_option) |~~~@if (($menu_option['menu_option_quantity']) == 1)- @else{{ $menu_option['menu_option_quantity'] }} -@endif~{{$menu_option['menu_option_name'] }} @endforeach @endforeach @endif

I was hoping that there was a way to render the HTML code that is being returned from $menu_option['menu_option_name'] (14" Large)

@receiptline
Copy link
Owner

How about the following function?

htmlspecialchars_decode — Convert special HTML entities back to characters
https://www.php.net/manual/en/function.htmlspecialchars-decode.php

@jduck1987
Copy link
Author

Awesome, I'll give that a try, thanks.

@jp555soul
Copy link

Bump on this issue.

Is there a way to do a checkbox?

Is there a way to fill in a box with a border?

Image attached below of request:

Screenshot 2024-01-08 at 1 43 37 PM

@receiptline
Copy link
Owner

Idea 1: Use square brackets

{b:line}
|^^^`4` WOK
-
|^^^[] ^^1x Drunken Noodle
|~        CHOOSE PROTEIN
|~        - Flank Steak
{b:space}

Idea 2: Use white squares and print as an image

{b:line}
|^^^`4` WOK
-
|^^^□  ^^1x Drunken Noodle
|~        CHOOSE PROTEIN
|~        • Flank Steak
{b:space}

Japanese, Chinese, and Korean printers can print □ (U+25A1 WHITE SQUARE) in device font.

@nataliacatala
Copy link

Heyy!
Is there a way to have a background color for a box?
I'm using the {b:line} Text {b:none} and I would like to fill my box with some color

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