I'm trying to read an existing pdf, resize it and then draw it on a new one.
Does somebody know how to do this? (API-Commands, c# prefered)
Reading and drawing works, I'm just looking for a simple way to make the
read pdf smaller,
so that it fits on a new page with additional text on top of that page.
Thank you for your help.
MfG
S.H.
I'm sorry, but that is not really what I was looking for.
Or I'm to stupid to unterstand your intention.
I'd like to read an existing pdf page, resize it, and draw it on a new page.
The page you linked, describes positioning of new text and graphics.
MfG
S.H.
> I'm sorry, but that is not really what I was looking for.
> Or I'm to stupid to unterstand your intention.
>
> I'd like to read an existing pdf page, resize it, and draw it on a new
page.
> The page you linked, describes positioning of new text and graphics.
Simple example (scales 1st page of In.PDF on an A4 page (lowerleft corner)
of Out.PDF):
....
PdfReader reader = new PdfReader("In.PDF");
Document doc = new Document(PageSize.A4, 0, 0, 0, 0);
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream("Out.PDF",
FileMode.Create));
doc.Open();
PdfContentByte cb = writer.DirectContent;
PdfImportedPage page = writer.GetImportedPage(reader, 1); //page #1
float Scale = 0.67f;
cb.AddTemplate(page, Scale, 0, 0, Scale, 0, 0);
doc.Close();
....
Govert
MfG
S.H.