hancypipl / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

Orphans, widows css rules #118

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Apply orphans, widows css rules
2. Create long text on end of page

What is the expected output? What do you see instead?
Expected: page break inserted if needed, orphans, widows css rules are applied
Actual result: page break not inserted

What version of the product are you using? On what operating system?
R8, uploaded Feb 01, core-renderer, Win7

Attached output pdf, test html

Original issue reported on code.google.com by rosa...@gmail.com on 16 Feb 2011 at 10:09

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
As I see isNeedPageClear in BlockBox gets called only before 
satisfyWidowsAndOrphans.

Original comment by rosa...@gmail.com on 16 Feb 2011 at 10:20

GoogleCodeExporter commented 9 years ago
1st of March svn version will solve your problem 
(iText-2.1.7.jar;core-renderer.jar)

Original comment by juhani.o...@gmail.com on 1 Mar 2012 at 10:09

GoogleCodeExporter commented 9 years ago
If test.html page is changed so that paragraph contains heading1 then it fails 
again.

<div><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam
dictum nibh erat, vel convallis odio. Aenean quis lorem eget ipsum
scelerisque euismod facilisis sit amet lorem. Nam interdum vestibulum
urna non aliquet. Pellentesque urna tellus, fermentum nec pharetra
vitae, sagittis quis nisi. Aliquam luctus molestie leo, nec luctus orci
egestas a. Curabitur convallis lacinia enim non sagittis. Pellentesque
consectetur mi et est interdum sed condimentum </p></div>
<div><p><h1>!!!!!!!Vestibulum fringilla molestie pulvinar.</h1> Nam lectus 
libero,
elementum non rutrum in, auctor id sem. Sed commodo, dolor blandit

Original comment by juhani.o...@gmail.com on 7 Mar 2012 at 9:13

GoogleCodeExporter commented 9 years ago
Hello! I have the same problem and solved it flyingsaucer Orphants take into 
account? I do not understand how to use "isNeedPageClear in Blockbox only gets 
called before satisfyWidowsAndOrphans"
 
Greatly appreciate the help

Original comment by moramari...@gmail.com on 9 May 2013 at 8:09

GoogleCodeExporter commented 9 years ago
if you are using 
iText-2.1.0

replace
javac -cp .;iText-2.1.7.jar;core-renderer.jar;  YourApp.java
java -verbose -cp .;iText-2.1.7.jar;core-renderer.jar; YourApp

then orphans start to work.

Original comment by juhani.o...@gmail.com on 21 May 2013 at 5:35

GoogleCodeExporter commented 9 years ago
Hello Juhani!
thanks for replying, apply the version that you recommend but when run I get 
the following error:

Exception in thread "main" java.lang.NoSuchMethodError: 
com.lowagie.text.pdf.BaseFont.getCharBBox (C)

Investigating I found that getCharBBox (C) change from char to int, any help?

Original comment by moramari...@gmail.com on 21 May 2013 at 2:33

GoogleCodeExporter commented 9 years ago
I solved! thank you very much! After the failure, download 
http://mvnrepository.com/artifact/org.xhtmlrenderer/flying-saucer-pdf/9.0.1 
http://mvnrepository.com/artifact/org.xhtmlrenderer/flying-saucer-core/9.0 .1

and add to my project (iText-2.1.7.jar, flying-saucer-core-9.0.1.jar and 
flying-saucer-pdf-9.0.1.jar) and generated the PDF using Orphan : D

Original comment by moramari...@gmail.com on 21 May 2013 at 6:54

GoogleCodeExporter commented 9 years ago
Hi moramari,

After adding the iText-2.1.7.jar, flying-saucer-core-9.0.1.jar and 
flying-saucer-pdf-9.0.1.jar, I still get below error:
Exception in thread "main" java.lang.NoSuchMethodError: 
com.lowagie.text.pdf.BaseFont.getCharBBox (C)

Can you tell me how did you fix it.

Thanks,
Sunil

Original comment by theorems...@gmail.com on 1 Apr 2015 at 7:08

GoogleCodeExporter commented 9 years ago
Hi moramari,

1) After adding the iText-2.1.7.jar, flying-saucer-core-9.0.1.jar and 
flying-saucer-pdf-9.0.1.jar, I still get below error:
Exception in thread "main" java.lang.NoSuchMethodError: 
com.lowagie.text.pdf.BaseFont.getCharBBox (C)

2) Also I am trying to link bootstrap.css while rendering the html.
Below is the line that I have added to link bootstrap.css:
<link rel='stylesheet' type='text/css' href='samples\bootstrap.css' 
media='print'/>

Can you please tell me how did you fix it.

Thanks,
Sunil

Original comment by theorems...@gmail.com on 1 Apr 2015 at 7:16