<cfdocument format="pdf" >
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
.block1, .block2{ width:200px; height:50px; background-color: #EEE; }
.block1{}
.block2{ margin-left:20px; margin-top:20px; }
</style>
</head>
<body>
<div class="block1">Block1</div>
<div class="block2">Block2</div>
</body>
</html>
</cfdocument>
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/3be89939-cf25-40a7-807a-26059565a5ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/CACtg%3DU%2Bazg8%3Daq1RKz6ZX46JiLw_FH3t7K66e8mRd%3DvG0Jfgpg%40mail.gmail.com.
Here is what I see. So pretty clearly not the same.CF9
Railo:<cfdocbug_cf9.jpg><cfdocbug_railo.jpg>
On Tue, Jun 17, 2014 at 3:29 AM, ML <min....@gmail.com> wrote:
I was expecting the two blocks to have the same height and width. The way browsers would show them. http://jsfiddle.net/PYWy9/
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/CACtg%3DU%2Bazg8%3Daq1RKz6ZX46JiLw_FH3t7K66e8mRd%3DvG0Jfgpg%40mail.gmail.com.--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/55AED4A8-DA7E-43E9-9549-040B25022FC0%40ongevraagdadvies.nl.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/3A40F250-2690-4597-97E9-CE970C674879%40ongevraagdadvies.nl.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/ED52F40A-6B7C-4496-850B-B9CE1C3DB4BD%40ongevraagdadvies.nl.
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/2f436114-d9c8-4d51-a16a-856c6b72fd4e%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/1ecde594-64ca-45af-b9e8-967bdcc3c84d%40googlegroups.com.
General Notes:
Railo uses PD4ML for HTML->PDF conversion. As of June 2014 (Railo 4.2), the version of PD4ML is 3.50 Beta 1 -- which was released in 2009.
Familiarize yourself with the fixes mentioned in the PD4ML release notes for the many versions after 3.50 beta 1 … and realize that we don’t have access to those fixes. Consider that a list of things to avoid.
PD4ML Release Notes: http://pd4ml.com/relnotes.htm
Here is a summary of what needs to be done to make a PDF render well with Railo
PDF Body MUST be a well formed HTML document (html tags, head section, body section)
Need a cfdocumentsection tag to set the top,right,bottom,left margins to .25 (or whatever design calls for)
styles must be declared in HEAD section
convert pt fonts to pixels (used this conversion chart as basis: http://reeddesign.co.uk/test/points-pixels.html)
Document needs as least one full width block element. Just a basic <div> will do.
put this style in stylesheet: html, body { width:8in; padding:0; margin: 0; } (width should be whatever the page size is minus the left and right margins on the cfdocumentsection tag)
span tags won't render background-color and can't be floated (probably applies to other inline html elements as well). I replaced the span with a floated div & modified the div's padding and margin
Special Considerations for Headers/Footers (cfdocumentitem)
header and footer must be HTML fragments (no body tag, html tag)
styles must be inline (won’t pick up styles declared in body, won’t pick up embedded style sheet inside header/footer)
Unlike CF8, Railo doesn't need the header height calculated into the margin-top
Special Considerations for Headers/Footers (pd4ml tags)
You can use <pd4ml:page.header> or <pd4ml:page.footer> blocks instead of cfdocumentitem.
Look at inline footer option for example: http://pd4ml.com/cookbook/pdf_header_footer_generation.htm
declare the header and footer blocks BEFORE the main content -- otherwise the </html> of the well-formed body will end the document. Anything after that point will not show up
there is a hardcoded rule that the header or footer cannot exceed ⅓ of the page height.
You can use the scope attribute to assign different headers/footers to different pages
cfdocumentitem and pd4ml tags don't play well together. Not sure if there is a valid reason to do this, I was just testing the limits.
Sources:
PD4ML Cookbook - http://pd4ml.com/cookbook/index.htm
Various Railo Group Discussion Threads - https://groups.google.com/forum/#!searchin/railo/pd4ml$20OR$20cfdocument%7Csort:date
Unresolved Issues in Railo Jira as of June 2014 - https://issues.jboss.org/browse/RAILO-1493?jql=project%20%3D%20RAILO%20AND%20status%20in%20(Open%2C%20%22Coding%20In%20Progress%22%2C%20Reopened)%20AND%20text%20~%20%22cfdocument%22
PD4ML Tag Library Reference - http://pd4ml.com/taglib/index.html
Header height limit - http://pd4ml.com/support/html-css-to-pdf-rendering-issues-f3/pd4ml-page-header-header-height-t134.html
The Web kit pdf thing is a very nice alternative which I've used with success. I also have a railo thread hang issue with cfdocument which only happens after the server has been running a while. I think I won't use cfdocument anymore based on what you guys are discussing here. Maybe it would be interesting to make a custom tag that emulates cfdocument behavior but uses webkit. This would make it a faster switch. In case anyone doesn't know, the webkit one is very easy and relies on a fast c binary
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/aa2b79a9-92b4-4093-9487-3f8e29b56822%40googlegroups.com.
--disable-javascript --disable-local-file-access
They won't be able to link to system files at least.