1

We are working on creating PDf from HTML which will be printed on Legal Page - It contains financial stamps only for first 3 pages at the top. So, we need to set big top margin for first 3 pages only for the space of the Financial Stamp and default margin for rest of the pages. We are using CYaHPConverter for HTML -> PDF conversion which does not support this dynamic margin setup on runtime pdf creation. Can anyone have any idea how to solve this problem with CSS or HTML. Or, suggest any other convertion library for this dynamic margin setup for different pages?

I tried YaHP-Converter's documentation and other popular library like - Aspose.PDF. But not sure how to pass the margin per page. I also tried Vanilla CSS but failed to get the idea.

1 Answers1

1

I don't know much about YaHP converter, but we can achieve this using the itextPdf library easily.

Here is the link which will help you in setting the different margins for different pages.

Based on personal experience, I suggest you use to itext v7 as it can process complicated HTML documents as well compared to v5. Check this for more information on why should we use v7

Note: itextpdf library is not free for commercial use, please check their site for further license-related information

Uma
  • 11
  • 2