In your latest changes, you can see that second auto-added page loose margins at least and thus
second table fills whole page width and you can't change margins.
If you set this - then the bug appears:
//Specify the size and margins for DOC
doc.PageSettings.Size = new SizeF(500.0f, 500.0f);
doc.PageSettings.Margins = margin;
Nina.Tang wrote:Hello,
After testing your code, I found a part of second table was wrongly drawn on the top of second page. Sorry the issue is caused by our free version, and we have no plan to update it at present. I tested the case with the latest
Spire.PDF Pack(Hot Fix) Version:4.3.4, the result was correct. Also I made some adjustments to your code. Please have a check.
Sincerely,
Nina
E-iceblue support team