简体   繁体   English

Azure web 应用程序与 PDFtk(PHP laravel 后端)

[英]Azure web app with PDFtk (PHP laravel backend)

I am trying to override the Voyager admin panel read view with a PDF form that is filled from fields in the DB.我正在尝试使用从数据库中的字段填充的 PDF 表单覆盖 Voyager 管理面板读取视图。

I achieved this through FPDM with PDFtk on localhost on a windows machine.我通过 FPDM 和 PDFtk 在 windows 机器上的本地主机上实现了这一点。 The problem is that the web app is hosted on Azure.问题是 web 应用程序托管在 Azure 上。 Is there any way to install PDFtk on the Azure side.有什么方法可以在 Azure 端安装 PDFtk。

And if not, is there another solution to approach this situation?如果没有,是否有另一种解决方案来解决这种情况?

Any help is appreciated.任何帮助表示赞赏。 Thanks in advance.提前致谢。

It sounds like your real question is how to install PDFtk on Azure WebApp for Windows.听起来您真正的问题是如何在 Azure WebApp 上为 Windows 安装 PDFtk。

Yes, I tried to install it and run a command pdftk.exe *.pdf cat output combined.pdf successfully.是的,我尝试安装它并成功运行命令pdftk.exe *.pdf cat output combined.pdf

Here is my steps below.下面是我的步骤。

  1. I downloaded an installation PDFtk Free from PDFtk offical website https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ .我从 PDFtk 官方网站https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/下载了安装PDFtk Free

    在此处输入图像描述

  2. I installed it into D:\Program Files\PDFtk my local Windows machine and move into the directory PDFtk\bin .我将它安装到D:\Program Files\PDFtk我的本地 Windows 机器中,然后进入目录PDFtk\bin

    在此处输入图像描述

  3. I was ready for two PDF files, such as Google.pdf and Bing.pdf which I got them via browse and print them as pdf in Chrome. I was ready for two PDF files, such as Google.pdf and Bing.pdf which I got them via browse and print them as pdf in Chrome.

    在此处输入图像描述

  4. I opened the Kudu console of my Azure WebApp, and command cd site\wwwroot to move to wwwroot path, and then I drag and drop these four files above in Step 2 & 3 into it.我打开我的 Azure WebApp 的 Kudu 控制台,并命令cd site\wwwroot移动到wwwroot路径,然后将上面第 2 步和第 3 步中的这四个文件拖放到其中。

    在此处输入图像描述

  5. Finally, I tried to only run pdftk.exe to get the help information successfully, and then to run pdftk.exe *.pdf cat output combined.pdf command and it works fine to get the combined.pdf file as Step 4 shown. Finally, I tried to only run pdftk.exe to get the help information successfully, and then to run pdftk.exe *.pdf cat output combined.pdf command and it works fine to get the combined.pdf file as Step 4 shown.

    在此处输入图像描述

So if you want to invoke it in programming, you just invoke its absolute path D:\home\site\wwwroot\pdftk.exe with its parameters from your code, it will work fine for you.因此,如果您想在编程中调用它,只需使用代码中的参数调用其绝对路径D:\home\site\wwwroot\pdftk.exe ,它就可以正常工作。

Note: Due to the Win32k.sys (User32/GDI32) Restrictions of Azure Web App sandbox , not every pdf conversion software can be installed on Azure WebApp as my did above. Note: Due to the Win32k.sys (User32/GDI32) Restrictions of Azure Web App sandbox , not every pdf conversion software can be installed on Azure WebApp as my did above. So PDFtk is a special software which not be implemented by using GDI.所以PDFtk是一个特殊的软件,不能使用 GDI 来实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM