简体   繁体   English

CreatePdfDocument 与 MoinMoin 1.9.7 一起挂起

[英]CreatePdfDocument hangs with MoinMoin 1.9.7

I've installed moinmoin 1.9.7 on a mac, and added the CreatePdfDocument action.我已经在 Mac 上安装了 moinmoin 1.9.7,并添加了 CreatePdfDocument 操作。 When using a very basic page (containing only the string "this page is left intentionally blank"), I am able to bring up the pdf configuration menu with当使用一个非常基本的页面(仅包含字符串“此页面有意留空”)时,我可以调出 pdf 配置菜单

http://somehost:8080/Page?action=CreatePdfDocument

and can proceed to the point where the server attempts to generate the pdf - it redirects to:并且可以继续到服务器尝试生成 pdf 的点 - 它重定向到:

http://localhost:8080/Page

and then serves the following html:然后提供以下 html:

<html><body marginwidth="0" marginheight="0" style="background-color: rgb(38,38,38)"><embed width="100%" height="100%" name="plugin" src="http://somehost:8080/Page" type="application/pdf"></body></html>

the moin-moin server appears to hang on that last request, never returning the generated pdf. moin-moin 服务器似乎挂在最后一个请求上,从不返回生成的 pdf。 I've added some debug statements to the CreatePdfDocument action source code, and I can see that the correct pdf is being generated.我在 CreatePdfDocument 操作源代码中添加了一些调试语句,我可以看到正在生成正确的 pdf。

Any ideas what might be going wrong, or where I can best start debugging this issue?任何想法可能会出错,或者我可以最好地开始调试这个问题? Since the server is hanging/not responding on the last request, I'm having trouble figuring out what the problem might be.由于服务器挂起/未响应最后一个请求,我无法弄清楚可能是什么问题。

Not a direct answer to your problem, but some years ago I cooked up my own method to create PDFs in MoinMoin using wkhtmltopdf because I found the likes of the CreatePdfDocument troublesome. 这不是直接解决您的问题的方法,但是几年前,我发现自己使用wkhtmltopdf在MoinMoin中创建PDF的方法很简单,因为我发现类似CreatePdfDocument的问题很麻烦。 If you are still interested, check out my self-help approach here . 如果您仍然有兴趣,请在此处查看我的自助方法。 It has been working satisfactorily now for several years. 现在它已经令人满意地工作了几年。 Also, apologies for not just adding this as comment but I am not permitted to do that at this stage. 另外,很抱歉,不只是将其添加为评论,还不允许我在此阶段这样做。

change inside function:改变内部功能:

send_pdf(self,data)
  'Content-Disposition': 'inline; filename="%s"' ....
to 
  'Content-Disposition': 'attachment; filename="%s"' ...

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

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