FitArea() needed even though there is enough space
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14.2k
- Forks
- 771
- Avg merge
- 3h 37m
- Merged PRs (30d)
- 11
Description
See attached sample project.
When creating an A5-sized PDF, adding an A5-sized SVG throws DocumentLayoutException. Is this expected? Certainly there is enough space when the SVG has the same size as the PDF? It works if you call FitArea() but why is it needed?
internal class Program
{
static void Main(string[] args)
{
QuestPDF.Settings.License = LicenseType.Evaluation;
try
{
Document.Create(container =>
{
container.Page(page =>
{
page.Size(PageSizes.A5);
// Size of test.svg is A5 (148x210 mm)
page.Content()
.Svg(@".\\Resources\\test.svg")
// .FitArea()
;
});
})
.GeneratePdf("hello.pdf");
}
catch (DocumentLayoutException ex)
{
// Unexpected?
throw;
}
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached QuestPdfTest3.zip sample and its Program.cs reproduction, including the A5 page, A5-sized test.svg, and DocumentLayoutException. Trace SVG layout with and without FitArea(); done means reproducing the behavior and either correcting the sizing issue or documenting the expected handling with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100