Create new PDF from existing PDF's

Hi,

I want to create a PDF where I start from a number of other PDF’s that I’m using as basis. I want to
- create an empty PDF
- add a page from an existing PDF
- update the page (including adding text, images, graphics, …)
- optionally add additional pages
- save as new pdf

When I’m looking at the documentation there are a number of classes that each perform single function of what I want to achieve, but I cannot seem to find the correct way to do the above.

It should be possible to generate a large number PDF documents.

Thanks for any advice
Peter

Hi Peter,

Thank you for considering Aspose.Pdf.

I think you can use Aspose.Pdf DOM to perform all your required operations. Please see the following documentation links for sample codes and details regarding your requirement.

http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/get-a-particular-page-of-the-pdf-file.html

http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/working-with-images.html

http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/working-with-text.html

Please do let us know in case you need any further assistance.

Thank You & Best Regards,

Thanks for the quick reply.

As I understand, if I wanted to draw lines and rectangles, I can use the PDF operators. But i cannot find any real documentation and/or examples how to use them from Aspose.Pdf.

Are they working as described in the Adobe PDF reference?

Peter

I’m in the same boat here - can you provide an example of creating shapes on a new PDF?


*** edit ***

Try this:

Document d = new Document();


d.Pages.Add();


OperatorCollection c = d.Pages[1].Contents;


c.Add(new Operator.MoveTo(25, 25));

c.Add(new Operator.LineTo(50, 50));

c.Add(new Operator.SetRGBColorStroke(.5, 0, 0));

c.Add(new Operator.Stroke());


d.Save("C:/temp/out/a.pdf");


*** /edit ***

Hi Cedar,

Thanks for your interest in our products.

You can use the below mentioned code to draw circle. In Aspose.Pdf.Generator namespace different classes are available with shape names to draw different shapes on new PDF document.

[C#]

Pdf pdf1 = new Pdf();
Section sec1 = pdf1.Sections.Add();
Graph graph1 = new Graph(sec1,100,400);
sec1.Paragraphs.Add(graph1);
Circle circle1 = new Circle(graph1,200,50,30);
graph1.Shapes.Add(circle1);
circle1.GraphInfo.Color = new Aspose.Pdf.Generator.Color("Red");
pdf1.Save(@"d:\pdffiles\circle.pdf");

For more details, please visit the following documentation links.

Shape Class
Circle Class

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,