如何最好地将服务器上的信息合并为“表单”,将PDF作为最终输出生成

时间:2022-07-03 21:09:44

Background:

I have a VB6 application I've "inherited" that generates a PDF for the user to review using unsupported Acrobat Reader OCX integration. The program generates an FDF file with the data, then renders the merged result when the FDF is merged with a PDF. It only works correctly with Acrobat Reader 4 :-(. Installing a newer version of Acrobat Reader breaks this application, making the users very unhappy.

我有一个我已经“继承”的VB6应用程序,它生成一个PDF供用户使用不支持的Acrobat Reader OCX集成进行查看。程序生成带有数据的FDF文件,然后在FDF与PDF合并时呈现合并结果。它只适用于Acrobat Reader 4 :-(。安装较新版本的Acrobat Reader会破坏此应用程序,使用户非常不满意。

I want to re-architect this app so that it will send the data to be merged to a PDF output generation server. This server will merge the data passed to it onto the form, generate a PDF image of this, and store it, so that any user wishing to view the final result can then simply get the PDF (it is generated just once). If the underlying data is changed, the PDF will be deleted and regenerated next time it is requested. The client program can then have any version of Acrobat Reader they wish, as it will be used exclusively for displaying PDF files (as it was intended). The server will most likely be written in .NET (C#) with Visual Studio 2005, probably as a Web Service...

我想重新构建这个应用程序,以便它将要合并的数据发送到PDF输出生成服务器。此服务器将传递给它的数据合并到表单上,生成此图像并存储它,以便任何希望查看最终结果的用户可以简单地获取PDF(它只生成一次)。如果更改了基础数据,则下次请求时将删除并重新生成PDF。然后,客户端程序可以拥有他们希望的任何版本的Acrobat Reader,因为它将专门用于显示PDF文件(按照预期)。服务器很可能用Visual Studio 2005用.NET(C#)编写,可能作为Web服务......

Question:

How would others recommend I go about this? Should I use Adobe's Acrobat 9 at the server to do this, puting the data into FDF or Adobe's XML format, and letting Acrobat do the merge? Are there great competitors in the "merge data onto form and output a PDF" space? How do others do this? It has to be API based, no GUI at the server, of course...

别人怎么会建议我这样做?我应该在服务器上使用Adobe的Acrobat 9来执行此操作,将数据放入FDF或Adobe的XML格式,并让Acrobat进行合并吗?在“将数据合并到表单并输出PDF”空间中是否存在很大的竞争对手?其他人如何做到这一点?它必须是基于API的,服务器上没有GUI,当然......

While some output is generated via FDF/PDF, another part of the application actually sends lines, graphics, and text to the printer (or a form for preview purposes) one page at a time, giving the proper x/y coordinates, font, size, etc. for each, knowing when it is at the end of a page, etc. This code is currently in the program that displays this for the user to review, and it is also in the program that prints the final form to the printer. For consistency between reviewer and printer, I'd like to move this output generation logic to a server as well, either using a good PDF generation API tool or use the code as is and generate a PDF with a PDF printer... and saving this PDF for display by the clients.

虽然某些输出是通过FDF / PDF生成的,但应用程序的另一部分实际上一次一页地将行,图形和文本发送到打印机(或用于预览的表单),给出正确的x / y坐标,字体,每个的大小等,知道它何时在页面的末尾等。此代码当前在程序中显示此代码供用户查看,并且它也在程序中将最终表单打印到打印机。为了使评论者和打印机之间保持一致,我想将这个输出生成逻辑移动到服务器上,使用一个好的PDF生成API工具或者按原样使用代码并使用PDF打印机生成PDF ...并保存此PDF供客户显示。

Googling "Form software" or "fill form software" or similar searches returns sooooooooo much unrelated material, mostly related to UI for users to fill in forms, I just don't know how to properly narrow down my search. This site seems the perfect place to ask such a question, as other programmers must also need to generate similar outputs, and have tried out some great tools.

谷歌搜索“表单软件”或“填写表单软件”或类似的搜索返回sooooooooo很多不相关的材料,大多与用户填写表单的UI有关,我只是不知道如何正确缩小我的搜索范围。这个网站似乎是提出这样一个问题的最佳地点,因为其他程序员也必须生成类似的输出,并尝试了一些很棒的工具。

EDIT:

I've added PDF tag as well as PDF-generation. Also, my current customer insists on PDF output, but I appreciate the alternative suggestions.

我添加了PDF标签以及PDF生成。此外,我目前的客户坚持PDF输出,但我很欣赏其他建议。

4 个解决方案

#1


1  

can't help with VB6 solution, can help with .net or java solution on the server.
Get iText or iTextSharp from http://www.lowagie.com/iText/.
It has a PdfStamper class that can merge a PDF and FDF FDFReader/FDFWriter classes to generate FDF files, get field names out of PDF files, etc...

不禁用VB6解决方案,可以帮助服务器上的.net或java解决方案。从http://www.lowagie.com/iText/获取iText或iTextSharp。它有一个PdfStamper类,可以合并PDF和FDF FDFReader / FDFWriter类来生成FDF文件,从PDF文件中获取字段名称等...

#2


0  

Take my advice. Ditch PDF for XPS. I am working on two apps, both server based. One displays image-based documents as PDFs in a browser. The second uses FixedPage templates to construct XPS documents bound to data sources.

听我的劝告。 DPS PDF for XPS。我正在开发两个基于服务器的应用程序。一个在浏览器中将基于图像的文档显示为PDF。第二个使用FixedPage模板构造绑定到数据源的XPS文档。

My conclusion after working on both projects is that PDFs suck; XPS documents less so. You have to pay cash money for a decent PDF library, whereas XPS comes with the framework. PDF document generation is a memory hog, has lots of potholes and isn't very server friendly. XPS docs have a much smaller footprint and less chances of shooting yourself in the foot.

在完成这两个项目后,我得出的结论是PDF文件很糟糕; XPS文件较少。你必须为一个体面的PDF库支付现金,而XPS附带框架。 PDF文档生成是一个记忆猪,有很多坑洼,并不是很服务器友好。 XPS文档的占地面积小得多,并且在脚下拍摄自己的机会也更少。

#3


0  

I have had great success using Microsoft Word. The form is designed in Word and composited with XML data. The document is run through a PDF converter (Neevia in this case, but there are better) to generate the PDF.

我使用Microsoft Word取得了巨大成功。表单在Word中设计并与XML数据合成。该文档通过PDF转换器(在本例中为Neevia,但有更好的方法)来生成PDF。

All of this is done in C#.

所有这些都是在C#中完成的。

#4


0  

Same boat. We're currently making pdfs this way: vb6 app drops a record into sql (with filename, create date, user, and final destination) and the xls (or doc) gets moved into a server directory (share) and the server has a vb.net service that has a filewatcher monitoring that directory. The file shows up, the service kicks off excel (word) to pdf the file via adobe, looks to sql to figure out what to do with the PDF when it is made, and logs the finish time.

同一条船。我们目前正在以这种方式制作pdf:vb6 app将记录删除到sql(带文件名,创建日期,用户和最终目的地),xls(或doc)被移动到服务器目录(共享),服务器有一个vb.net服务,它有一个监视该目录的filewatcher。文件显示,服务通过adobe启动excel(word)到pdf文件,查看sql以确定在制作时如何处理PDF,并记录完成时间。

This was the cheap solution- it only took about a day to do the code and another day to debug both ends and roll the build out.

这是一个廉价的解决方案 - 它只花了大约一天的时间来完成代码,另一天只需要调试两端并完成构建。

This is not the way to do it. Adobe crashes at random times when trying to make the pdfs. it will run for two weeks with no issues at all, and then (like today) it will crash every 5 minutes. or every other hour. or at 11:07, 2:43, 3:05, and 6:11.

这不是这样做的方法。在尝试制作pdf时,Adobe会随机崩溃。它将运行两周而没有任何问题,然后(像今天一样)它将每5分钟崩溃一次。或每隔一小时。或者在11:07,2:43,3:05和6:11。

We're going to convert the stuff out of excel and word and drop the data directly into pdfs using PDFTron in the next revision. Yes, PDFTron costs money, (we bought the 1-kilobuck-per-processor license) but it will do the job, and nicely. XPS are nice but I, like you, have to provide PDFs. It is the way of things.

我们将在excel和word中转换这些东西,并在下一版本中使用PDFTron将数据直接删除到pdf中。是的,PDFTron需要花钱,(我们购买了1千比特每处理器许可证),但它可以完成这项工作,而且非常好。 XPS很不错,但我和你一样,必须提供PDF。这是事情的方式。

Check out pdfTron (google it) and see if it will do what you want. Then you just got to figure out which license you need and how you gonna pay for it. If someone comes up with something better, hope they'll vote it to the top of the list!!!

查看pdfTron(谷歌),看看它是否会做你想要的。然后你就可以弄清楚你需要哪个许可证以及你将如何支付它。如果有人想出更好的东西,希望他们将其投票到列表的顶部!

#1


1  

can't help with VB6 solution, can help with .net or java solution on the server.
Get iText or iTextSharp from http://www.lowagie.com/iText/.
It has a PdfStamper class that can merge a PDF and FDF FDFReader/FDFWriter classes to generate FDF files, get field names out of PDF files, etc...

不禁用VB6解决方案,可以帮助服务器上的.net或java解决方案。从http://www.lowagie.com/iText/获取iText或iTextSharp。它有一个PdfStamper类,可以合并PDF和FDF FDFReader / FDFWriter类来生成FDF文件,从PDF文件中获取字段名称等...

#2


0  

Take my advice. Ditch PDF for XPS. I am working on two apps, both server based. One displays image-based documents as PDFs in a browser. The second uses FixedPage templates to construct XPS documents bound to data sources.

听我的劝告。 DPS PDF for XPS。我正在开发两个基于服务器的应用程序。一个在浏览器中将基于图像的文档显示为PDF。第二个使用FixedPage模板构造绑定到数据源的XPS文档。

My conclusion after working on both projects is that PDFs suck; XPS documents less so. You have to pay cash money for a decent PDF library, whereas XPS comes with the framework. PDF document generation is a memory hog, has lots of potholes and isn't very server friendly. XPS docs have a much smaller footprint and less chances of shooting yourself in the foot.

在完成这两个项目后,我得出的结论是PDF文件很糟糕; XPS文件较少。你必须为一个体面的PDF库支付现金,而XPS附带框架。 PDF文档生成是一个记忆猪,有很多坑洼,并不是很服务器友好。 XPS文档的占地面积小得多,并且在脚下拍摄自己的机会也更少。

#3


0  

I have had great success using Microsoft Word. The form is designed in Word and composited with XML data. The document is run through a PDF converter (Neevia in this case, but there are better) to generate the PDF.

我使用Microsoft Word取得了巨大成功。表单在Word中设计并与XML数据合成。该文档通过PDF转换器(在本例中为Neevia,但有更好的方法)来生成PDF。

All of this is done in C#.

所有这些都是在C#中完成的。

#4


0  

Same boat. We're currently making pdfs this way: vb6 app drops a record into sql (with filename, create date, user, and final destination) and the xls (or doc) gets moved into a server directory (share) and the server has a vb.net service that has a filewatcher monitoring that directory. The file shows up, the service kicks off excel (word) to pdf the file via adobe, looks to sql to figure out what to do with the PDF when it is made, and logs the finish time.

同一条船。我们目前正在以这种方式制作pdf:vb6 app将记录删除到sql(带文件名,创建日期,用户和最终目的地),xls(或doc)被移动到服务器目录(共享),服务器有一个vb.net服务,它有一个监视该目录的filewatcher。文件显示,服务通过adobe启动excel(word)到pdf文件,查看sql以确定在制作时如何处理PDF,并记录完成时间。

This was the cheap solution- it only took about a day to do the code and another day to debug both ends and roll the build out.

这是一个廉价的解决方案 - 它只花了大约一天的时间来完成代码,另一天只需要调试两端并完成构建。

This is not the way to do it. Adobe crashes at random times when trying to make the pdfs. it will run for two weeks with no issues at all, and then (like today) it will crash every 5 minutes. or every other hour. or at 11:07, 2:43, 3:05, and 6:11.

这不是这样做的方法。在尝试制作pdf时,Adobe会随机崩溃。它将运行两周而没有任何问题,然后(像今天一样)它将每5分钟崩溃一次。或每隔一小时。或者在11:07,2:43,3:05和6:11。

We're going to convert the stuff out of excel and word and drop the data directly into pdfs using PDFTron in the next revision. Yes, PDFTron costs money, (we bought the 1-kilobuck-per-processor license) but it will do the job, and nicely. XPS are nice but I, like you, have to provide PDFs. It is the way of things.

我们将在excel和word中转换这些东西,并在下一版本中使用PDFTron将数据直接删除到pdf中。是的,PDFTron需要花钱,(我们购买了1千比特每处理器许可证),但它可以完成这项工作,而且非常好。 XPS很不错,但我和你一样,必须提供PDF。这是事情的方式。

Check out pdfTron (google it) and see if it will do what you want. Then you just got to figure out which license you need and how you gonna pay for it. If someone comes up with something better, hope they'll vote it to the top of the list!!!

查看pdfTron(谷歌),看看它是否会做你想要的。然后你就可以弄清楚你需要哪个许可证以及你将如何支付它。如果有人想出更好的东西,希望他们将其投票到列表的顶部!