我们应该使用什么语言来创建包含大量表格、颜色和图像的印刷材料?

发布于 2024-08-20 22:41:52 字数 1491 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

心作怪 2024-08-27 22:41:52

如果您考虑 TEX 领域的内容,我强烈建议您查看 ConT EXt,因为它不太针对科学论文,而更多地致力于创建相当自由的布局。正如 dmckee 所说,您可以使用 LaTeX 来实现这一点,如果您内部有人已经具备所需的专业知识,那就太好了。但如果没有,那么,关于 LaTeX 的书籍数量要多得多,但我上次看时,大多数书籍并没有真正提出我愿意遵循的任何建议。 (我可以做像你在 LaTeX 或 ConTeXt 中展示的那样的事情,尽管已经有一段时间了。)

If you consider something from the TEX area, I'd strongly suggest looking at ConTEXt, since it is much less aimed at scientific papers and much more at creating pretty free-form layout. As dmckee said, you could use LaTeX for that and if you have someone in-house who already has the required expertise, great. But if not, well, the number of books on LaTeX is way higher, but last time I looked, most of them did not really present any advice I'd be willing to follow. (I could do things like what you presented in LaTeX or ConTeXt, although it's been a while.)

暗恋未遂 2024-08-27 22:41:52

ReportLab for Python 非常不错。

ReportLab Toolkit 是经过时间验证、超强大的开源引擎,用于以编程方式创建 PDF 文档,并构成了 RML 的基础;它还包含一个用于创建独立于平台的矢量图形的库。它是一个用 Python 编写的快速、灵活、跨平台的解决方案。

此处输出示例。

ReportLab for Python is pretty nice.

The ReportLab Toolkit is the time-proven, ultra-robust open-source engine for programatically creating PDF documents and forms the foundation of RML; it also contains a library for creating platform-independent vector graphics. It's a fast, flexible, cross platform solution written in Python.

Sample output here.

淑女气质 2024-08-27 22:41:52

如果你要打印,你绝对应该使用 Latex 而不是 html。 html 对于管理印刷材料来说听起来像是一场噩梦。

我在工作中也面临着同样的情况:我有大约70份文件,其中很多是重复材料。我选择在section级别进行拆分;也就是说,每个文档中的每个 \section{} 都是其自己的 .tex 文件。然后,我将使用输入命令从这些文件“构建”文档:

\input{documentname}(输入命令不采用文件扩展名)

现在,当我需要更新某个文件时信息,我更新一个文件,然后重新编译所有受影响的文件。它对我来说效果很好。我遇到的唯一问题是查找哪些文档受到文件更改的影响,但这并不是在一堆不同文件之间复制/粘贴的问题。

我尝试让我的 tex 代码尽可能简单。如果出于某种原因我需要将内容发布到网络上,pandoc 通常会为我提供 97%(如果不是 100%)的信息,但我 95% 的内容只是打印的。如果您需要使用多种发布媒体(即印刷、网络等),您可能会考虑使用元格式,例如 markdown、multimarkdown、重组文本或类似的格式。维基百科对此类内容进行了总结:http://en.wikipedia.org/wiki/Lightweight_markup_language。我发现 Markdown 最容易使用,但它缺乏对表格等的支持,而且我发现重组文本具有最多的功能。

话虽这么说,我很高兴使用 Latex + pandoc。乳胶的结果很漂亮。

If you are going for print, you should definitely use latex over html. html sounds like a nightmare for managing printed material.

I face the same situation at work: I have about 70 documents, and a lot of it is repeat material. I choose to split at the section level; that is, each \section{} in every document is its own .tex file. I will then "build" the documents from these files using the input command:

\input{documentname} (the input command doesn't take the file extension)

Now, when I need to update a piece of information, I update one file, then just re-compile all the effected documents. It's working rather well for me. The only problem I run across is locating which documents are effected by a file change, but this is much less of a problem that copy/pasting between a bunch of different files.

I try and keep my tex code as simple as possible. If for some reason I need to post things to the web, pandoc usually gets me 97%, if not 100%, of the way there, but I 95% of my stuff is print only. If you need to go to multiple publishing mediums (i.e. print, web, etc) you might consider a meta-format, such as markdown, multimarkdown, restructured text, or something similar. Wikipedia has a summary of such things here: http://en.wikipedia.org/wiki/Lightweight_markup_language. I find markdown the easiest to use, but it lacks support for tables and such, and I find that restructured text has the most features.

That being said, I am very happy using latex + pandoc. the results from latex are beautiful.

謌踐踏愛綪 2024-08-27 22:41:52

LaTeX可以做类似的事情。这并不是说这一定是最简单的方法。

这就是我会使用的,因为我已经使用它近二十年了。

如果您打算尝试 Latex,请注意 < code>\input 和 \include,并准备花一些时间使用 CTAN 查找其他人已经解决了您的问题的地方。

LaTeX can do something like that. Which is not to say that it is necessarily the easiest way.

It is what I would use, because I've been using it for nearly two decades now.

If you are going to try latex, take note of the \input and \include macros, and be prepared to spend some time with CTAN finding the places where other people have already solved your problems.

眼中杀气 2024-08-27 22:41:52

iText 是一个用于 Java 的 PDF 库,我认为是 C 语言。尽管我自己没有在生产中使用它,但它具有良好的声誉。我用它模拟了一些演示并且非常高兴。

iText is a PDF library for Java and I think C-sharp. It has a good reputation although I haven't used it in production myself. I have mocked up some demos with it and was quite happy.

最佳男配角 2024-08-27 22:41:52

你需要重新表述你的问题。

阅读第一部分让我意识到您的问题在于内容生成而不是消费。您是否尝试过使用模板(您的用例对我来说似乎是 VDP 案例)。

然而,最后,您谈到创建打印材料,输出的最佳选择是 PostScript 和/或如果可以的话 - PDF。 CSS media=print 又与输出/消费端相关。

You need to rephrase your question.

Reading the first part gives me the idea that your problem is with content generation and not consumption. Have you tried using templates (your use case seems to be a VDP case for me).

However, at the end, you talk about creating print material and the best choice of output is PostScript and/or if you can -- PDF. The CSS media=print is again something related on the output/consumption side.

南…巷孤猫 2024-08-27 22:41:52

无论哪种方式你都可以做到。过去,我在 HTML、LaTeX、Word 和 Excel 文档方面都取得了成功。

无论您选择哪种,您都需要创建一个模板,您可以填写该模板以适应演示文稿中的更改,而与内容无关。

Perl 的 HTML::Template 将有助于填补空白< /em>.

下面有一个原始的 HTML 示例。要正确操作,请阅读分页媒体

<!DOCTYPE HTML>
<html>
<head>
<title>Test</title>

<link id="screen-reset" rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css"
media="screen">

<link id="print-reset" rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css"
media="print">

<style type="text/css" media="print,screen">
    html { width:8.5in; font-size:16px; font-family:Arial; }
    body { margin: 0 auto; }
    @page {margin:1in }
    .page { page-break-after:always}
    .title { background: #911; height:1in; }
    .title h1 { 
        color:#fff; 
        background:transparent;
        display:inline-block;
        font-size:1.75em;
        font-weight:bold;
        height:1in; 
        line-height:0.5in;
        position:relative;
        top:0.125in;
        left:0.125in;
        text-decoration:underline;
        text-transform:uppercase;
        vertical-align:middle;
        width:75%;
    }

    .title h2 { 
        background:#fff;
        border:solid 1px #000;
        color:#000;
        font-size:0.75em;
        height:0.75in; 
        position:relative; top:0.125; left:0.125in; display:inline-block;
        text-align:center;
        vertical-align:middle;
        width:1in; 
    }

    .category {
        background:#bbb;
        color:#fff;
        font-size:1.25em;
        font-weight:bold;
        height:0.5in;
        padding:1%;
        width:98%;
        text-transform:uppercase;
    }


</style>

</head>
<body>
<div class="page">
<div class="title">
<h1>Job Instruction Breakdown Sheet</h1>
<h2>Revision Code</h2>
</div>

<h2 class="category">
13 - Attic Critical Detail: Flue, Combustion Vents & Chimneys
</h2>
</div>

<div class="page">
<div class="title">
<h1>Some other Sheet</h1>
<h2>Revision Code</h2>
</div>

<h2 class="category">
14 - Other Details
</h2>
</div>

</body>
</html>

使用浏览器的打印预览功能(您可能必须选择特定的浏览器才能生成输出)并设置“打印背景图像和颜色”或在您喜欢的浏览器中调用的任何选项。

You could do it either way. In the past, I have had success with both HTML, LaTeX, Word and Excel documents.

Whichever you choose, you would need to create a template which you can fill in to accommodate changes in the presentation independently of the content.

Perl's HTML::Template would be helpful in filling in the blanks.

There is a primitive HTML example below. To do it right, read about paged media.

<!DOCTYPE HTML>
<html>
<head>
<title>Test</title>

<link id="screen-reset" rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css"
media="screen">

<link id="print-reset" rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css"
media="print">

<style type="text/css" media="print,screen">
    html { width:8.5in; font-size:16px; font-family:Arial; }
    body { margin: 0 auto; }
    @page {margin:1in }
    .page { page-break-after:always}
    .title { background: #911; height:1in; }
    .title h1 { 
        color:#fff; 
        background:transparent;
        display:inline-block;
        font-size:1.75em;
        font-weight:bold;
        height:1in; 
        line-height:0.5in;
        position:relative;
        top:0.125in;
        left:0.125in;
        text-decoration:underline;
        text-transform:uppercase;
        vertical-align:middle;
        width:75%;
    }

    .title h2 { 
        background:#fff;
        border:solid 1px #000;
        color:#000;
        font-size:0.75em;
        height:0.75in; 
        position:relative; top:0.125; left:0.125in; display:inline-block;
        text-align:center;
        vertical-align:middle;
        width:1in; 
    }

    .category {
        background:#bbb;
        color:#fff;
        font-size:1.25em;
        font-weight:bold;
        height:0.5in;
        padding:1%;
        width:98%;
        text-transform:uppercase;
    }


</style>

</head>
<body>
<div class="page">
<div class="title">
<h1>Job Instruction Breakdown Sheet</h1>
<h2>Revision Code</h2>
</div>

<h2 class="category">
13 - Attic Critical Detail: Flue, Combustion Vents & Chimneys
</h2>
</div>

<div class="page">
<div class="title">
<h1>Some other Sheet</h1>
<h2>Revision Code</h2>
</div>

<h2 class="category">
14 - Other Details
</h2>
</div>

</body>
</html>

Use the print preview function of your browser (you might have to to settle on a specific browser to generate the output) and set "Print background images & colors" or whatever that option is called in your favorite browser.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文