PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Odd Table Border Rendering?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1465
Page 1 of 1

Author:  jeffhare [ Tue Dec 07, 2010 11:29 pm ]
Post subject:  Odd Table Border Rendering?

Hi,

I am seeing some table/cell border drawing behavior that is a bit puzzling.

So I created a small test table in MigraDoc with:
  • all CELL borders set to RED with 4px Top, 3px Right, 2px Bottom, 1px Left border thicknesses (set on each cell via Cell.Borders.Top/Left/Right/Bottom ).
  • and a 4px thick BLUE table outer border (set via the Table.SetEdge() specifying the entire range of cells inthe table)
When the table is rendered, the "inner" table borders look as I'd expect them to and the outer border looks perfect as well, except that the Inner border horizontal and vertical lines are drawn overlapping the "outer" borders on the left, right and bottom edges but are fine at the top edge. Is this a drawing order issue?
The result is:
Attachment:
Capture.JPG
Capture.JPG [ 29.15 KiB | Viewed 6896 times ]


Anyone have any ideas on how I can fix or control the rendering of this?

I don't completely understand the border merging/rendering process in Migradoc and any assistance would be greatly appreciated. :D

-Jeff

Author:  Thomas Hoevel [ Wed Dec 08, 2010 8:55 am ]
Post subject:  Re: Odd Table Border Rendering?

Hi, Jeff,

I presume you're creating a PDF file.

Do you use GDI+ or WPF build? (I dunno if it makes a difference.)

Why not set 2,2,2,2 borders?

With more information and some sample code (e. g. MigraDoc DDL and a PDF file) I can take a look at this issue.

Author:  jeffhare [ Wed Dec 08, 2010 3:58 pm ]
Post subject:  Re: Odd Table Border Rendering?

Hi Thomas,

I'm using GDI+ and so far things have worked pretty well.

My application migrates Lotus Notes database documents into Microsoft SharePoint. One of the target formats is PDF. My framework builds Migradoc document objects from the Lotus Notes document elements trying to preserve visual fidelity as closely as possible. So, while I could use 2,2,2,2 borders, the Lotus source doc really defines what these should be.

I've attached a zip containing the PDF, MDDL file and an image of the original source doc (just for reference).

As a side note, I mostly have access to both the Table border and the Cell borders individually in the source format. I am satisfied with the Migradoc way of simulating a table or table region border by altering the outside facing cell edges, just that when the colors aren't the same there's some overdraw going on I haven't found a way to eliminate.

Thanks
-Jeff

Attachments:
File comment: PDF, MDDL and JPG of source
3.22 Inner Cell and Outer Table Borders.zip [105 KiB]
Downloaded 584 times

Author:  mooflu [ Wed Dec 08, 2010 7:02 pm ]
Post subject:  Re: Odd Table Border Rendering?

How about setting the table border via SetEdge and then adding a paragraph to each cell and setting the paragraph's border instead of applying the border to the cell directly?

I think the fundamental issue is that all table borders are really drawn as cell borders. Cell borders also extend beyond their cell boundary resulting in overlap. That's ok when the border color is the same and opaque. It gets ugly when the border color changes or is partially transparent.

Frank.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/