php - 使用 wkhtmltopdf 打印 url
问题描述
我的问题是我需要用 wkhtmltopdf 打印一个 url,但是打印的 url 是这样开始的:
<?php
session_start();
if (!isset($_SESSION['login'])) {
header('Location:../../../index.php');
}
这意味着必须对用户进行身份验证,但是从 wkhtmltopdf 生成的文件会打印 index.php 而不会打印 imprimir_ingreso.php 的内容。
到目前为止,这是我的代码源:
<?php
session_start();
if (!isset($_SESSION['login'])){
header("Location:../../index.php");
}
$sesion_id= session_id();
system("C://\"Program Files\"//wkhtmltopdf//bin//wkhtmltopdf --cookie 'sessionid' $sesion_id http://localhost/proyecto/hc/php/admisiones/ambulatorio/imprimir_ingreso.php?id_ingreso=84 hc.pdf");
我不知道这到底在做什么--cookie 'sessionid' $sesion_id,因为要打印的 url 以此开头!isset($_SESSION['login'])以使用未经身份验证的用户重定向到 index.php。
解决方案
推荐阅读
- php - 源代码如何管理空白和连接
- vue.js - vue.js:范围自定义选项合并策略而不是全局
- mysql - 使用 MySQL Json_search 函数使用不区分大小写的搜索获取 JSON 数据中值的路径表达式
- javascript - Laravel - 无法从谷歌饼图监听器中获取价值
- unit-testing - vue单元测试 - 触发事件(表单提交)后数据未按预期更新
- ios - 为什么使用选择器需要@objc 标签?
- linux - 在不离开 bash 脚本的情况下中断 logcat?
- typo3 - FilesProcessor 与在自定义内容元素中归档的资产
- laravel - Laravel nova 工具 - 添加日期选择器
- c# - 从请求转换波斯数字