PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Jul 20, 2024 9:14 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed May 29, 2024 12:33 pm 
Offline

Joined: Wed May 29, 2024 12:20 pm
Posts: 3
When some rows in a table are merged down the height of the rows is not automatically increased to fit the text or image in the merged cell.

The issue occour in PDFsharp-MigraDoc-GDI Version="6.0.0"
It did work perfectly in PDFsharp-MigraDoc-GDI Version="1.50.5147"

I there any way to get around this?

Attachment:
Udklip.PNG
Udklip.PNG [ 27.45 KiB | Viewed 3021 times ]


Top
 Profile  
Reply with quote  
PostPosted: Wed May 29, 2024 1:00 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 951
Location: CCAA
This should still work.

See also:
https://docs.pdfsharp.net/General/Issue-Reporting.html

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Wed May 29, 2024 3:25 pm 
Offline

Joined: Wed May 29, 2024 12:20 pm
Posts: 3
Here is some sample code

public void Test2()
{
Document document = new Document();
Section section = document.AddSection();

Table table = new Table();
table.Borders.Width = 0.75;

table.AddColumn("1cm");
table.AddColumn("2cm");
table.AddColumn("8cm");

Row row1 = table.AddRow();
table.AddRow();
table.AddRow();

table.Rows[0].Cells[2].MergeDown = 2;

row1.Cells[2].AddParagraph("slædkæl ækd la lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs slædkasældk æsldlsakdælsakd laskdl ksa ldklaskdælaksld ksaæ saldk læsakdæl skdælskaldksaældkasældklæaskdl sald lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs slædkasældk æsldlsakdælsakd laskdl ksa ldklaskdælaksld ksaæ saldk læsakdæl skdælskaldksaældkasældklæaskdl sald lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs ldklaskdælaksld ksaæ saldk læsakdæl skdælskaldksaældkasældklæaskdl sald lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs ");
document.LastSection.Add(table);

string folderName = System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\";
string fileName = folderName + @"\pdfdocument2.pdf";

System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer();
pdfRenderer.Document = document;
pdfRenderer.RenderDocument();
pdfRenderer.PdfDocument.Save(fileName);
}


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 05, 2024 11:41 am 
Offline

Joined: Wed May 29, 2024 12:20 pm
Posts: 3
When some rows in a table are merged down the height of the rows is not automatically increased to fit the text or image in the merged cell.

The issue occour in PDFsharp-MigraDoc-GDI Version="6.0.0"
It did work perfectly in PDFsharp-MigraDoc-GDI Version="1.50.5147"

Attachment:
Udklip.PNG
Udklip.PNG [ 27.45 KiB | Viewed 2747 times ]


Here is some sample code

public void Test2()
{
Document document = new Document();
Section section = document.AddSection();

Table table = new Table();
table.Borders.Width = 0.75;

table.AddColumn("1cm");
table.AddColumn("2cm");
table.AddColumn("8cm");

Row row1 = table.AddRow();
table.AddRow();
table.AddRow();

table.Rows[0].Cells[2].MergeDown = 2;

row1.Cells[2].AddParagraph("slædkæl ækd la lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs slædkasældk æsldlsakdælsakd laskdl ksa ldklaskdælaksld ksaæ saldk læsakdæl skdælskaldksaældkasældklæaskdl sald lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs slædkasældk æsldlsakdælsakd laskdl ksa ldklaskdælaksld ksaæ saldk læsakdæl skdælskaldksaældkasældklæaskdl sald lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs ldklaskdælaksld ksaæ saldk læsakdæl skdælskaldksaældkasældklæaskdl sald lsæakdlæas k dlskad lkslæd ksal dkaslkd lasækd laæs ");
document.LastSection.Add(table);

string folderName = System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\";
string fileName = folderName + @"\pdfdocument2.pdf";

System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer();
pdfRenderer.Document = document;
pdfRenderer.RenderDocument();
pdfRenderer.PdfDocument.Save(fileName);
}


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 06, 2024 1:01 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
LeFroq wrote:
I there any way to get around this?
It is a bug. Thanks for the feedback.
Row height is correct with MergeDown = 1.
Problem occurs with MergeDown = 2 and MergeDown = 3. Most likely any value greater than 1 will show that bug.

If your requirements allow to work with MergeDown = 1, then the bug will not affect you.
I don't know when this bug will be fixed.
Sorry for the inconvenience.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group