Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border not printed with "overflow: hidden" #297

Closed
maresja1 opened this issue Nov 24, 2018 · 3 comments
Closed

Border not printed with "overflow: hidden" #297

maresja1 opened this issue Nov 24, 2018 · 3 comments

Comments

@maresja1
Copy link

In RC-17 there is a problem with rendering span with overflow: hidden and border. For following HTML:

<!DOCTYPE HTML>
<html>
<head>
	<style>
		@page {size:  500px 500px;}body {margin: 0;}

		.letterField {
			border: 2px solid #008e7e;
			border-right: 0;
			border-left-width: 1px;
			float: left;
			padding: 2px 3px;
			font-size: 10px;
			display: inline-block;
			color: #000;
			font-weight: bold;
			width: 6px;
			overflow: hidden;
		}

		.letterField:first-child {
			border-left: 2px solid #008e7e;
		}

		.letterField:last-child {
			border-right: 2px solid #008e7e;
		}

	</style>
</head>
<title></title>
<body>
<span class="letterField">AASLKDJ</span>
</body>
</html>

I get this on RC-17:
image
And this on RC-16:
image

See attached PDF files.
border-overflow-RC16.pdf
border-overflow-RC17.pdf

@maresja1
Copy link
Author

Also noticed now, that I can see very very thin border when displaying the PDF inside the browser, but not at all with gnome's evince.

@danfickle
Copy link
Owner

Hi @maresja1,

Thanks for the concise example and expected images.

I could replicate your behavior (very thin border in Mac Preview, none in Acrobat), but only when I used the fast mode renderer, which is not ready for production use yet. The output was equivalent to RC16 image when using this builder code:

    public static void main(String... args) throws Exception { 
        try (OutputStream os = new FileOutputStream("/Users/me/Documents/pdf-issues/output/issue-297.pdf")) {
            PdfRendererBuilder builder = new PdfRendererBuilder();
            builder.withUri("file:///Users/me/Documents/pdf-issues/issue-297.htm");
            builder.toStream(os);
            builder.testMode(true);
            //builder.useFastMode(); // Could only replicate by uncommenting this line!
            builder.run();
        }
    }

I can confirm this is still an issue in head in the fast mode renderer and will add a test now. If by any chance you are not using the fast mode, could you post your builder code so I can replicate?

danfickle added a commit that referenced this issue Nov 26, 2018
…order.

Border is not visible in output PDF.
@danfickle
Copy link
Owner

It appears the problem only appears with floated elements with overflow hidden and a border. I never would have found that so thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants