We need to generate PDF from HTML with ABCPDF, letting 3 mm bleedbox on every side of the document. So that after printing there is enough room for cutting the edges of the page and bind a book from the printed pages.
I have tried below code with some variations.
I am not able to get exact documentation (I doubt it exists). The nearest documentation is here.
I wonder if someone has done this or can guide in the right direction.
Here's the code snippet to start with.
using WebSupergoo.ABCpdf8;
namespace BleedBoxDemo
{
class Program
{
static void Main(string[] args)
{
string filePath = @"c:\myhtmldocument.html";
if (System.IO.File.Exists(filePath))
{
string content = System.IO.File.ReadAllText(filePath);
Doc theDoc = new Doc();
theDoc.MediaBox.String = "A4";
theDoc.Page = theDoc.AddPage();
theDoc.SetInfo(theDoc.Page, "/BleedBox:Rect", "20 20 180 280");
//for (int i = 1; i <= 2; i++)
//{
// theDoc.FrameRect();
// theDoc.Rect.Inset(20, 20);
//}
//theDoc.Save(@"C:\mypdfdocument.PDF");
//theDoc.Clear();
theDoc.AddHtml(content);
theDoc.Rect.String = "0 0 612 792";
theDoc.FrameRect();
theDoc.Rect.Inset(20, 20);
theDoc.Save(@"C:\mydocumentwithbleedbox.PDF");
theDoc.Clear();
}
}
}
}