【问题标题】:Getting a Garbage value on Printing a Page in PHP Desktop在 PHP 桌面打印页面时获取垃圾值
【发布时间】:2020-04-25 19:00:14
【问题描述】:

我正在打印一张发票,我填写了用于打印的输入值,在生成最终发票后,我得到的垃圾值格式不正确,我在下面的图片中分享了。但是,如果我在外部浏览器上使用 Php Desktop,那么打印页面会得到正确的值。提前致谢。

这是我的 php 桌面 json

{
"application": {
    "single_instance_guid": "",
    "dpi_aware": true
},
"debugging": {
    "show_console": false,
    "subprocess_show_console": false,
    "log_level": "DEBUG4",
    "log_file": "debug.log"
},
"main_window": {
    "title": "PHP Desktop",
    "icon": "",
    "default_size": [1024, 768],
    "minimum_size": [800, 600],
    "maximum_size": [0, 0],
    "disable_maximize_button": false,
    "center_on_screen": true,
    "start_maximized": false,
    "start_fullscreen": false,
    "print": true
},
"popup_window": {
    "icon": "",
    "fixed_title": "",
    "center_relative_to_parent": true,
    "default_size": [1024, 768]
},
"web_server": {
    "listen_on": ["127.0.0.1", 0],
    "www_directory": "www",
    "index_files": ["index.html", "index.php"],
    "cgi_interpreter": "php/php-cgi.exe",
    "cgi_extensions": ["php"],
    "cgi_temp_dir": "",
    "404_handler": "/pretty-urls.php"
},
"chrome": {
    "log_file": "debug.log",
    "log_severity": "default",
    "cache_path": "webcache",
    "external_drag": true,
    "external_navigation": true,
    "reload_page_F5": true,
    "devtools_F12": true,
    "remote_debugging_port": 0,
    "command_line_switches": {},
    "enable_downloads": true,
    "context_menu": {
        "enable_menu": true,
        "navigation": true,
        "print": true,
        "view_source": true,
        "open_in_external_browser": true,
        "devtools": true
    }
  }
}

以上 json 用于 PHP 桌面设置,我应该更改此 json 中的任何内容吗?

下面是我的代码。

function data() {


        var separateDecimal = lclTotal.toString().split('.');
        var paisa = parseInt(separateDecimal[1]);
        var paisaInt = parseInt(paisa);

        $("#txtPrintName").val($("#name").val());
        $("#txtPrintAddress").val($("#address").val());
        $("#txtPrintMobile").val($("#mobile").val());

    }

$(document).on("click", "#print", function (e) {

                // $("#supplier-info, #invoice-no, #txtUniqueNo, #delivery-note, #supplier-reference, #txtSupplierRef, #buyer, #buyer-label, #buyer-label, #txtCusName, #txtAddress, #txtGSTIN").printThis({
                  $("#printCode").printThis({
                    debug: true,               // show the iframe for debugging
                    importCSS: true,            // import page CSS
                    importStyle: true,          // import style tags
                    printContainer: true,       // grab outer container as well as the contents of the selector
                    loadCSS:"sale.css", // path to additional css file - use an array [] for multiple
                    pageTitle: "TAX INVOICE",   // add title to print page
                    removeInline: true,         // remove all inline styles from print elements
                    printDelay: 300,            // variable print delay; depending on complexity a higher value may be necessary
                    base: true,                
                    footer: "",                 // prefix to html
                    formValues: true            // preserve input/form values
                });

            });

【问题讨论】:

  • 在哪一行?
  • 啊,现在您确实有一些代码,但可能不是导致问题的代码(JSON 主要是配置数据) - 问题可能出在 您的代码 - 我假设你已经写了一些,因为你是在一个编码帮助网站上问的
  • 如果我在 chrome 浏览器上打开 php Desktop,那么它可以在 Chrome 上运行。
  • @Keri 您需要分享您的代码,以便我们能够分辨出问题所在,我们是魔术师。

标签: javascript php desktop-application


【解决方案1】:

我得到了解决,我更改了 PHP 桌面的版本。

【讨论】:

    猜你喜欢
    • 2022-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-05
    • 1970-01-01
    • 2011-09-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多