转换后的pdf设计 [英] converted pdf desgin

查看:71
本文介绍了转换后的pdf设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用ItextSharp类创建了pdf文件,并且可以正常工作,并且我使用内联样式表在代码文件中创建了html文件,并且工作正常,但是转换后的pdf文件看起来并不像我想要的与html相同,我有链接,您可以在其中看到我的pdf文件和实际的html屏幕截图.
1. http://melisa.aleaitsolutions.co.uk/images/TestReport.pdf [ ^ ]
2. http://melisa.aleaitsolutions.co.uk/images/Test1.jpg [ http://melisa.aleaitsolutions.co.uk/images/Test2.jpg [ http://melisa.aleaitsolutions.co.uk/images/Test3.jpg [

I have created the pdf using ItextSharp class and it will work fine and i have created html in code file using inline style sheet and its work fine but my converted pdf not look as i would i like to same as my html ,Below i have link where you can see my pdf file and actual html screen shot .
1.http://melisa.aleaitsolutions.co.uk/images/TestReport.pdf[^]
2.http://melisa.aleaitsolutions.co.uk/images/Test1.jpg[^]
3.http://melisa.aleaitsolutions.co.uk/images/Test2.jpg[^]
4.http://melisa.aleaitsolutions.co.uk/images/Test3.jpg[^]
Hope this will work , waiting for answer shortly
Thanks in advance

推荐答案

恭喜!这是一个非常不错的PDF(嗯,布局可能会更好一些,但是您可以轻松地对其进行改进.

现在,您应该对文档无法精确匹配此信息的HTML呈现感到失望. 从原则上讲这是不可能的.无论如何,您都不应该努力做出完美的搭配.这两种文档格式基于非常不同的设计原理. PDF就像电子打印版本:所有渲染都牢固地固定在每张纸上.相反,HTML是流动的,并且没有固定的视图:它取决于许多因素,首先,Web浏览器窗口的客户区域的宽度,浏览器的版本,其呈现默认值(通常,CSS定义仅渲染的重要细节,其余部分保留为默认设置.

两种格式的结构元素之间也存在一对一的对应关系-HTML更具逻辑性,它提供了很好的逻辑结构与表示形式的隔离(大多数情况下委托给CSS),并且随着标准的发展,这种隔离变得越来越深(与HTML5比较).相比之下,PDF则更多是原始的渲染标准.我认为您比我最近完成这项工作时了解的要多.

那么,如何在实践中解决这个问题呢?


我认为您所能做的就是对两种格式的文档的纯设计进行改进.这比图形编程更多的是图形设计师的工作,更多是与应用认知科学有关的.您需要关注任何格式共有的一些功能,这些功能会引起人们的注意,而文档的结构水平可能会使差异对于感知而言不是必不可少的.最好的办法是在文档的结构级别上工作.例如,如果您具有三个级别的文档部分(如HTML中的h1h2h3),则使该部分的标题变为可识别,因此读者可以轻松地识别出哪个级别是因为它的功能,而不是测试本身的细节(缩进,边距,字体等,因为对段落的感知更加流畅并且取决于渲染条件).另外,使文档设计保持简单也非常重要.您不应使用任何单一装饰,甚至不要使用没有明确目的的细线.

祝你好运,
—SA
Congratulations! This is a pretty nice PDF (well, a layout could be a bit better, but you can easily improve it.

Now, you should be be disappointed that your document cannot precisely match the HTML rendering of this information. This is not possible in principle. You should not try to hard to make a perfect match, anyway. These two document formats are build on very different design principles. PDF is like an electronic print version: all rendering is solidly fixed on each sheet of paper. In contrast, HTML is fluid and it does not have any fixed view: it depends on many factors, first of all, the width of the client area of the Web browser window, version of the browser, its rendering defaults (usually, CSS defines only important details of rendering leaving the rest to defaults).

There is also know one-to-one correspondence between structural elements of both formats — HTML is much more logical, it provides pretty good isolation of logical structure from presentation (which is mostly delegated to CSS) and this isolation becomes deeper as the standards develops (compare with HTML5). In contrast, PDF is much more raw rendering standard. I think you know this much better than I do as you recently finished this job.

So, how to solve this problem in practice?


I think all you can do is improvement of the pure design of the document in both formats. This is more of graphical designer work than programming, is more about applied cognitive science. You need to focus of some features common to any format which will catch the human eyes on the level of structure of the document which can make the differences not essential for perception. The best thing to do it is to work at the level of structure of the document. For example, if you have three levels of document section (like h1, h2 and h3 in HTML) make the title of the section recognizable, so the reader could easily recognize what level is that by its features, but not by the detail of the test itself (indents, margins, font, etc. as the perception of the paragraph is more fluid and dependent on the rendering conditions). Also, it''s very important to keep the document design simple. You should not use any single decoration, not even a tiny line without well-defined purpose.

Good luck,
—SA


这篇关于转换后的pdf设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆