page-breaks in html or pdf?
[1/15] from: petr::krenzelok::trz::cz at: 5-Dec-2003 11:49
Hi,
our company is sending aviso documents to customers. Aviso is in html
form or in pdf form. I have to say, that it is probably generated by
some SAP automat. The code is pretty ugly - strict css usage - placing
ALL elements onto absolute pixel positions.
The problem is, that if there is more than one doc for customer at one
batch, it is generated as multi-doc document (html or pdf) - but - some
of our customers complained that it is really difficult to print that
way. I chcecked out and did not find any way of how to issue something
like page-break in html. It is probably not even possible. What about
pdf? Is there any chance to insert page-break into pdf doc?
So far the fastest fix seems to be parsing html doc, dividing it into
separate files - I could create some encapsulated tool for that, but I
would rather fix problem in our primary ERP system than go for
workarounds ...
Thanks,
-pekr-
[2/15] from: SunandaDH:aol at: 5-Dec-2003 6:11
Petr:
> I chcecked out and did not find any way of how to issue something
> like page-break in html. It is probably not even possible.
CSS2 supports paged-media:
http://www.w3.org/TR/REC-CSS2/page.html#page-size-prop
But it may not be supported by the browsers your customers use. If it is, or
you can get them to use a modern browser (Opera? Mozilla? I haven't checked
which support paged media), that may solve your problem.
PDFs do support paging, but I can't answer how. Hopefully, someone else can
help you with that,
Sunanda.
[3/15] from: andreas:bolka:gmx at: 5-Dec-2003 12:10
Friday, December 5, 2003, 11:49:00 AM, Petr wrote:
> I chcecked out and did not find any way of how to issue something
> like page-break in html. It is probably not even possible.
there are two CSS properties named page-break-before and
page-break-after. by using e.g.
span style="page-break-after: always;"
you could achieve what you want. however, i don't know which browsers
respect those attributes.
--
Best regards,
Andreas
[4/15] from: bry:itnisk at: 5-Dec-2003 12:24
>The problem is, that if there is more than one doc for customer at one
>batch, it is generated as multi-doc document (html or pdf) - but - some
>of our customers complained that it is really difficult to print that
>way. I chcecked out and did not find any way of how to issue something
>like page-break in html. It is probably not even possible.
Well it's not really possible, but there is in css the possibility of
setting your css to be a specific media:
http://www.w3.org/TR/REC-CSS2/media.html
Some implementations have come along that I believe allows you to
specify that .mypagebreakclass starts a new page for example.
> What about
>pdf? Is there any chance to insert page-break into pdf doc?
Well I know it's possible to break a page programmatically in pdf,
however when I work with pdf generation I do so from one remove, using
xsl-fo.
Of course there is a pdf standard, which I don't have a link to right at
the moment, which goes into monstrously exhaustive detail about such
things as breaking pages.
http://www.xml.com/pub/a/2002/03/20/xsl-fo.html
a propos the css+html method, yeslogic http://yeslogic.com/ has a
product prince that supports css3 media properties with some extensions
to better handle pagination requirements (I'm pretty sure one could
force page-breaks), I looked at it in version 2.0 but found that it
wasn't good enough for my requirements, considering that we had an
xsl-fo based media channel for our Media Organizer product MediaMaxx
that was far more advanced than I could see easily building with prince,
that said for people with simpler needs something like prince would
probably be a good solution.
[5/15] from: juff:fax at: 5-Dec-2003 11:31
> The problem is, that if there is more than one doc for customer at one
> batch, it is generated as multi-doc document (html or pdf) - but - some
<<quoted lines omitted: 6>>
> would rather fix problem in our primary ERP system than go for
> workarounds ...
In html you can force a page-break relative to a specific tag
choose a tag - I think most will do - and add the page break property to it
in an in-line style sheet
for example using the h4 / 5 tags:
<style>
h4 {page-break-before:always}
h5 {page-break-after:always}
</style>
Now just put in an <h4> when you want the page break to occur before the
next information or <h5> when you want the page break to occur after...
then IE will do a form feed in the appropriate places
wow! I answered a question!
- still know nothing about rebol :-)
Regards
John Uff
[juff--fax--co--uk]
http://fax.co.uk tel: +44 1493 393411 fax: +44 1493 393811
The UK's Email / Fax Gateway
[6/15] from: bry:itnisk at: 5-Dec-2003 12:57
>our company is sending aviso documents to customers.
I don't know anything about aviso documents, can you send me a pertinent
link? I googled, but it turned up a bunch of not likely to be relevant
stuff.
[7/15] from: petr:krenzelok:trz:cz at: 5-Dec-2003 13:46
Andreas Bolka wrote:
>Friday, December 5, 2003, 11:49:00 AM, Petr wrote:
>>I chcecked out and did not find any way of how to issue something
<<quoted lines omitted: 6>>
>you could achieve what you want. however, i don't know which browsers
>respect those attributes.
Thanks all to your answers! However - something like following did not
work. Neither with IE 5.5 nor Mozilla 6.1a
<span style="page-break-before:always"></span>
btw - as we are here discussin html/css issues, I have following questions:
- our document does not look good in mozilla. It uses absolute pixel
positioning for each element. But drawn table (using following code)
makes it shifted:
<span style="left:0pt;top:000000pt;height:842pt;width:595pt">
<span style="left:022pt;top:099pt;height:100pt;width:266pt;border:001pt
solid #000000;background-color:#FFFFFF"></span>
<span style="left:288pt;top:099pt;height:100pt;width:266pt;border:001pt
solid #000000;background-color:#E6E6E6"></span>
<span style="left:022pt;top:198pt;height:596pt;width:533pt;border:001pt
solid #000000;background-color:#FFFFFF"></span>
I found the difference - IE, when using borders, still keeps the size
of the rectangle intact and margins of the area are substracted from the
inner area space, otoh Mozilla keeps internal box area intact and border
is drawn outside such box.
I would like also to know, what is the difference in using <span> and
<pre> styles - I simply replaced above 'span styles by 'pre ones and now
even Mozilla draws it correctly.
-pekr-
[8/15] from: bry:itnisk at: 5-Dec-2003 15:26
Neither span nor pre are good to be using for what you want to do, pre
if I remember correctly is supposed to be for keeping things as they are
(deprecated and replaced by xmp if I recall correctly, although these
are both not elements that I am in the habit of using), span on the
other hand is for text that is considered to be inside of something else
that needs to have another style placed on it. Although you can say that
a span has size and position etc. (and sometimes to get a result from ie
with minimum of effort you might want to do this) the usage should be to
give spans styling such as bold, i, u, fonts, colors, etc.
Stuff that is positioned etc. should probably be done via DIVS.
As I said before I know that there are some implementations (prob.
Half-assed) of css2+ media possibilities out there, and one of these is
in IE, to get this to work might be problematic.
I would try to follow something like this:
http://www.4guysfromrolla.com/demos/printMediaCss.html
i.e set your media attribute to be print on the stylesheet, give the
span a specific class, then see if you can get page breaking when you
print.
So on the other subject, aviso is just an internal document format you
mean, it's not a well-known document format output by some company etc.
referencable by standards?
[9/15] from: bry:itnisk at: 5-Dec-2003 15:31
Also by using the @media property, http://www.ncdesign.org/html/s001.htm
as shown here.
Actually this just made me think about your problem, it might be
worthwhile to second guess the browser developer at this point, are the
pagination properties of css implemented if you have not given your
media as being specifically print, I'm betting not, as it might have
been easier to implement them if one assumed the developer always had to
declare the media as not being screen(the default).
[10/15] from: tserpa:earthlink at: 5-Dec-2003 9:15
Petr Krenzelok wrote:
>I found the difference - IE, when using borders, still keeps the size
> of the rectangle intact and margins of the area are substracted from the
> inner area space, otoh Mozilla keeps internal box area intact and border
> is drawn outside such box.
That is a well-known CSS parsing bug in IE5.x/Windows. For a description of
the problem (you actually pretty much described it) and a solution for
overcoming it go here - http://tantek.com/CSS/Examples/boxmodelhack.html
I also noticed that you are using points as your units of measure. As you
probably know, points are great for printed media but not so good for the
screen. You should probably use two style sheets, one for printing and one
for screen display using pixels and percentages.
Ted
[11/15] from: greggirwin:mindspring at: 5-Dec-2003 10:52
Hi John,
JU> wow! I answered a question!
JU> - still know nothing about rebol :-)
:). The great thing here is that we all have different skills. I'm not
much help with web-related stuff. By combining our talents, we can all
do great things together.
-- Gregg
[12/15] from: greggirwin:mindspring at: 5-Dec-2003 10:52
Hi Petr,
In PDF, it's something like "/Page", but may need to combine with
other things. Not sure. Gabriele might be able to say, since he did
PDF-maker.
-- Gregg
[13/15] from: sf:sabufrancis at: 6-Dec-2003 0:48
Hi:
I dont know whether a small self-advertisement is permitted
on this forum... but here goes ...
I've written a utitlity called Simple-PDF that can be
used to create PDF files from ascii text. It is a very
primitive sort of DTP application. But it has a command-line
program also in the same package.
It can also split the text to create multi-page PDF files.
Download it here: http://www.simplepdf.com/setup2.zip
The command-line version is available in Linux also.
Regards
Sabu Francis
P.S: I hope either my mailer, or Ecartis does not insert line-breaks
in my post! More than page-breaks, I'm getting irritated by
the line-breaks in my own posts :-)
[14/15] from: AJMartin:orcon at: 24-Dec-2003 22:50
I have my scripts insert this HTML (using CSS):
<br style="page-break-after: always" />
It's placed at the start of each "page" after the first "page", using a
Rebol script fragment like:
First_Page?: true
;...
; Inside page creation loop:
either First_Page? [
First_Page?: none
] [
<br style="page-break-after: always" />
]
I also make sure that I use this tag:
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
for each page, to make sure the MS IE switches into the right mode. If it's
not present, MS IE 6 interprets HTML and CSS as if it were an older browser
complete with bugs!
I also have two different media sections in my .css stylesheet, like:
@media screen {
body {
background: url(Wiki.jpg) #FFFFFC repeat-y fixed;
color: #000000;
margin: 0px;
padding: 0px;
}
.Left-Column {
position: absolute;
}
...
}
and
@media print {
.Left-Column {
display: none;
}
...
}
I hope that helps!
Andrew J Martin
Speaking in tongues and performing miracles.
ICQ: 26227169
http://www.rebol.it/Valley/
http://valley.orcon.net.nz/
http://Valley.150m.com/
[15/15] from: g:santilli:tiscalinet:it at: 10-Dec-2003 13:06
Hi Gregg,
On Friday, December 5, 2003, 6:52:57 PM, you wrote:
GI> In PDF, it's something like "/Page", but may need to combine with
GI> other things. Not sure. Gabriele might be able to say, since he did
GI> PDF-maker.
Well, it's not that you can insert page breaks somewhere; a PDF
document is made of pages that have some content. So if you wanted
to split a page into two you'd have to basically create a new
document with two pages and place the content into each of them...
not very trivial as the content stream is stateful, so just
splitting it up might not work.
In conclusions, I don't think I understand what Petr was asking
about the PDF version. (That's why I didn't answer before... btw,
I've been unable to connect to the Internet since Friday, and I'm
a little behind with email etc. now...)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted