谷歌如何在Google Analytics中制作那些精彩的PDF报告,以及何时打印Google Doc等?

时间:2021-10-25 15:18:39

When you print from Google Docs (using the "print" link, not File/Print) you end up printing a nicely formated PDF file instead of relying on the print engine of the browser. Same is true for some of the reports in Google Analytics . . . the printed reports as PDF's are beautiful. How do they do that? I can't imagine they use something like Adobe Acrobat to facilitate it but maybe they do. I've seen some expensive HTML to PDF converters online from time to time but have never tired it. Any thoughts?

当您从Google Docs打印时(使用“打印”链接,而不是文件/打印),您最终会打印格式良好的PDF文件,而不是依赖浏览器的打印引擎。 Google Analytics中的某些报告也是如此。 。 。 PDF格式的打印报告非常漂亮。他们是怎么做到的?我无法想象他们使用类似Adobe Acrobat的东西来促进它,但也许他们这样做。我不时在网上看到一些昂贵的HTML到PDF转换器,但从来没有厌倦过它。有什么想法吗?

6 个解决方案

#1


13  

If you are specifically looking at how Google does it. If you look at the PDF Properties page, they use Prince 6.0 (see princexml.com)

如果您特别关注Google如何做到这一点。如果您查看PDF属性页面,他们会使用Prince 6.0(请参阅princexml.com)

There are lots of other PDF generators out there. I've had great success with PDFlib for tricky jobs.

那里有很多其他的PDF生成器。我在PDFlib上获得了非常成功的工作。

谷歌如何在Google Analytics中制作那些精彩的PDF报告,以及何时打印Google Doc等?

#2


3  

iTextSharp and iText are opensource and free PDF generation libraries for .NET and Java respectively.

iTextSharp和iText分别是.NET和Java的开源和免费PDF生成库。

I've used them to generate report PDF's before and was quite happy with the results.

我之前用它们来生成报告PDF,并对结果非常满意。

http://itextsharp.sourceforge.net/

http://www.lowagie.com/iText/

#3


3  

Great free alternative to PrinceXML: wkhtmltopdf . There are plenty of wrapper libraries for various languages - but I've only used Ruby ones. However the product itseld is on par with PrinceXML IMHO.

PrinceXML的绝佳替代品:wkhtmltopdf。有很多用于各种语言的包装库 - 但我只使用了Ruby。然而,产品itseld与PrinceXML恕我直言相提并论。

#4


1  

I have had success with pd4ml. It has a tag library, so you can turn any existing HTML into PDF by

我用pd4ml取得了成功。它有一个标记库,因此您可以将任何现有的HTML转换为PDF

<pd4ml:transform>
<!-- Your HTML is here -->

<c:import url="/page.html" />
</pd4ml:transform>

#5


-1  

Well, I doubt it's as easy as generating HTML . . . I mean, first of all, PDF is not a human readable format and it's not plain text (like SVG). In fact, I would compare a SVG file to a PDF file in that with both you have precise control over the layout on a printed page. But SVG is different in that it's XML (and also in that it's not supported completely in the browser . . . still looking into SVG too). Come to think of it, SVG should probably will be my next question.

好吧,我怀疑它就像生成HTML一样容易。 。 。我的意思是,首先,PDF不是人类可读的格式,它不是纯文本(如SVG)。事实上,我会将SVG文件与PDF文件进行比较,因为您可以精确控制打印页面上的布局。但SVG的不同之处在于它的XML(并且在浏览器中完全不支持它......还在研究SVG)。想想看,SVG应该是我的下一个问题。

I know Google doesn't use .NET and I doubt they use Java so there must be some other libraries they use for generating the PDF files. More importantly, how do they create the PDF's without having to rewrite everything as a PDF instead of as HTML? I mean, there has to be some shared code for between when they generate the HTML view as opposed to the PDF view. Come to think of it, maybe the PDF view and the HTML view are completely separate and they just have two views and hence why the MVC development style seems to be the way to go.

我知道谷歌不使用.NET,我怀疑他们使用Java,因此必须有一些其他库用于生成PDF文件。更重要的是,他们如何创建PDF而不必将所有内容重写为PDF而不是HTML?我的意思是,在生成HTML视图而不是PDF视图时,必须有一些共享代码。想想看,也许PDF视图和HTML视图是完全分开的,它们只有两个视图,因此MVC开发风格似乎是要走的路。

#6


-3  

Rendering a PDF is hard, complex problem. However generating them, is not. Simply make up some entities, and generate. It's about same problem domain as generating HTML for webpage vs. displaying (rendering) it.

渲染PDF是一个困难而复杂的问题。然而,生成它们不是。只需组成一些实体,然后生成。它与为网页生成HTML与显示(呈现)它的问题领域相同。

#1


13  

If you are specifically looking at how Google does it. If you look at the PDF Properties page, they use Prince 6.0 (see princexml.com)

如果您特别关注Google如何做到这一点。如果您查看PDF属性页面,他们会使用Prince 6.0(请参阅princexml.com)

There are lots of other PDF generators out there. I've had great success with PDFlib for tricky jobs.

那里有很多其他的PDF生成器。我在PDFlib上获得了非常成功的工作。

谷歌如何在Google Analytics中制作那些精彩的PDF报告,以及何时打印Google Doc等?

#2


3  

iTextSharp and iText are opensource and free PDF generation libraries for .NET and Java respectively.

iTextSharp和iText分别是.NET和Java的开源和免费PDF生成库。

I've used them to generate report PDF's before and was quite happy with the results.

我之前用它们来生成报告PDF,并对结果非常满意。

http://itextsharp.sourceforge.net/

http://www.lowagie.com/iText/

#3


3  

Great free alternative to PrinceXML: wkhtmltopdf . There are plenty of wrapper libraries for various languages - but I've only used Ruby ones. However the product itseld is on par with PrinceXML IMHO.

PrinceXML的绝佳替代品:wkhtmltopdf。有很多用于各种语言的包装库 - 但我只使用了Ruby。然而,产品itseld与PrinceXML恕我直言相提并论。

#4


1  

I have had success with pd4ml. It has a tag library, so you can turn any existing HTML into PDF by

我用pd4ml取得了成功。它有一个标记库,因此您可以将任何现有的HTML转换为PDF

<pd4ml:transform>
<!-- Your HTML is here -->

<c:import url="/page.html" />
</pd4ml:transform>

#5


-1  

Well, I doubt it's as easy as generating HTML . . . I mean, first of all, PDF is not a human readable format and it's not plain text (like SVG). In fact, I would compare a SVG file to a PDF file in that with both you have precise control over the layout on a printed page. But SVG is different in that it's XML (and also in that it's not supported completely in the browser . . . still looking into SVG too). Come to think of it, SVG should probably will be my next question.

好吧,我怀疑它就像生成HTML一样容易。 。 。我的意思是,首先,PDF不是人类可读的格式,它不是纯文本(如SVG)。事实上,我会将SVG文件与PDF文件进行比较,因为您可以精确控制打印页面上的布局。但SVG的不同之处在于它的XML(并且在浏览器中完全不支持它......还在研究SVG)。想想看,SVG应该是我的下一个问题。

I know Google doesn't use .NET and I doubt they use Java so there must be some other libraries they use for generating the PDF files. More importantly, how do they create the PDF's without having to rewrite everything as a PDF instead of as HTML? I mean, there has to be some shared code for between when they generate the HTML view as opposed to the PDF view. Come to think of it, maybe the PDF view and the HTML view are completely separate and they just have two views and hence why the MVC development style seems to be the way to go.

我知道谷歌不使用.NET,我怀疑他们使用Java,因此必须有一些其他库用于生成PDF文件。更重要的是,他们如何创建PDF而不必将所有内容重写为PDF而不是HTML?我的意思是,在生成HTML视图而不是PDF视图时,必须有一些共享代码。想想看,也许PDF视图和HTML视图是完全分开的,它们只有两个视图,因此MVC开发风格似乎是要走的路。

#6


-3  

Rendering a PDF is hard, complex problem. However generating them, is not. Simply make up some entities, and generate. It's about same problem domain as generating HTML for webpage vs. displaying (rendering) it.

渲染PDF是一个困难而复杂的问题。然而,生成它们不是。只需组成一些实体,然后生成。它与为网页生成HTML与显示(呈现)它的问题领域相同。