Google search results suggested that it's possible via PHP/Java Bridge . This bridge requires Java Application Server. My host (bluehost) does not allow to run any Java Application Server. What are the alternatives in this case to make iText work? Switching a host is not viable option for me.
谷歌搜索结果表明它可以通过PHP / Java Bridge实现。此桥接器需要Java Application Server。我的主机(bluehost)不允许运行任何Java Application Server。在这种情况下,有什么方法可以使iText工作?切换主机对我来说不是一个可行的选择。
Thanks.
谢谢。
4 个解决方案
#1
0
There's always iTextSharp, a C# translation of iText. Will your host let you run C#?
总有iTextSharp,iText的C#翻译。你的主人会让你运行C#吗?
It looks like you can call C# from PHP, as detailed here.
看起来你可以从PHP调用C#,详见此处。
#2
0
I know this is an old post, but for those still looking for an answer, may I suggest having Java do your work for you as a REST service using Jersey (JAX-RS), then just call the service from PHP. You can put your Java service on a host that does allow Java and you can call that service from PHP using cURL (or even file_get_contents if your host allows it and if you know what you're doing).
我知道这是一篇旧帖子,但对于那些仍在寻找答案的人,我可以建议让Java为你做一个使用Jersey(JAX-RS)的REST服务,然后从PHP调用服务。您可以将Java服务放在允许使用Java的主机上,并且可以使用cURL从PHP调用该服务(如果主机允许,甚至可以使用file_get_contents,如果您知道自己在做什么)。
Loose coupling over RESTful services is allows you to have your Java service and your PHP app on separate hosts. Don't waste you time with a PHP/Java Bridge. It's perfectly sane to call a RESTful service with a Java back-end from PHP. This way, later if you decide, your would rather re-do the service in C# or something else, at least there will be 0 impact on the PHP app because you used a language neutral RESTful approach.
RESTful服务上的松散耦合允许您将Java服务和PHP应用程序放在不同的主机上。不要浪费你的时间使用PHP / Java Bridge。使用PHP的Java后端调用RESTful服务是完全理智的。这样,以后如果你决定,你宁愿用C#或其他东西重新做服务,至少会对PHP应用程序产生0影响,因为你使用了语言中立的RESTful方法。
I have not had any performance issues using this approach myself, YMMV
我自己也没有遇到任何性能问题,YMMV
(It's mostly a matter of design: It's usually better to "bolt" things together then "weld" them together.)
(这主要是设计问题:通常最好将“固定”在一起然后将它们“焊接”在一起。)
Also, Java with JAX-RS is very very simple (IMHO, but again .. YMMV)
此外,Java与JAX-RS非常简单(恕我直言,但再次.. YMMV)
#3
0
The ITEXT website specifically says JAVA and .NET, Wish they can also build the PHP or PERL version
ITEXT网站专门说JAVA和.NET,希望他们也可以构建PHP或PERL版本
I have used the Java Itext, Its superb!!
我使用了Java Itext,它的精湛!!
#4
-1
PDFtk is a command line tool installed on many Linux systems. It is a front end to the iText library. It may do what you need. You'd have to shell out to the command line to invoke it from PHP.
PDFtk是许多Linux系统上安装的命令行工具。它是iText库的前端。它可能会做你需要的。您必须向命令行发出外壳以从PHP调用它。
#1
0
There's always iTextSharp, a C# translation of iText. Will your host let you run C#?
总有iTextSharp,iText的C#翻译。你的主人会让你运行C#吗?
It looks like you can call C# from PHP, as detailed here.
看起来你可以从PHP调用C#,详见此处。
#2
0
I know this is an old post, but for those still looking for an answer, may I suggest having Java do your work for you as a REST service using Jersey (JAX-RS), then just call the service from PHP. You can put your Java service on a host that does allow Java and you can call that service from PHP using cURL (or even file_get_contents if your host allows it and if you know what you're doing).
我知道这是一篇旧帖子,但对于那些仍在寻找答案的人,我可以建议让Java为你做一个使用Jersey(JAX-RS)的REST服务,然后从PHP调用服务。您可以将Java服务放在允许使用Java的主机上,并且可以使用cURL从PHP调用该服务(如果主机允许,甚至可以使用file_get_contents,如果您知道自己在做什么)。
Loose coupling over RESTful services is allows you to have your Java service and your PHP app on separate hosts. Don't waste you time with a PHP/Java Bridge. It's perfectly sane to call a RESTful service with a Java back-end from PHP. This way, later if you decide, your would rather re-do the service in C# or something else, at least there will be 0 impact on the PHP app because you used a language neutral RESTful approach.
RESTful服务上的松散耦合允许您将Java服务和PHP应用程序放在不同的主机上。不要浪费你的时间使用PHP / Java Bridge。使用PHP的Java后端调用RESTful服务是完全理智的。这样,以后如果你决定,你宁愿用C#或其他东西重新做服务,至少会对PHP应用程序产生0影响,因为你使用了语言中立的RESTful方法。
I have not had any performance issues using this approach myself, YMMV
我自己也没有遇到任何性能问题,YMMV
(It's mostly a matter of design: It's usually better to "bolt" things together then "weld" them together.)
(这主要是设计问题:通常最好将“固定”在一起然后将它们“焊接”在一起。)
Also, Java with JAX-RS is very very simple (IMHO, but again .. YMMV)
此外,Java与JAX-RS非常简单(恕我直言,但再次.. YMMV)
#3
0
The ITEXT website specifically says JAVA and .NET, Wish they can also build the PHP or PERL version
ITEXT网站专门说JAVA和.NET,希望他们也可以构建PHP或PERL版本
I have used the Java Itext, Its superb!!
我使用了Java Itext,它的精湛!!
#4
-1
PDFtk is a command line tool installed on many Linux systems. It is a front end to the iText library. It may do what you need. You'd have to shell out to the command line to invoke it from PHP.
PDFtk是许多Linux系统上安装的命令行工具。它是iText库的前端。它可能会做你需要的。您必须向命令行发出外壳以从PHP调用它。