Sign In  Sign Up Live-Chat

How can I insert a pdf page in a pdf page

Last post 06-12-2007, 4:37 AM by JRebel. 10 replies.
Sort Posts: Previous Next
  •  05-30-2007, 7:07 AM 78538

    How can I insert a pdf page in a pdf page

    Dear Aspose,

    I have a pdf template with page numbers and a heather and footer.

    I will insert a pdf page in this template (so that the heather and footer of the template and page numbering don't change). It's like an ImgageField in my template -that I have created in Adobe Acrobat Forms- and then filled with an image (FillImageField ...etc). So: Is there a way to insert a pdf file the same way as I insert an image?

    Thanks.

    J. Rebel

     
  •  05-30-2007, 9:21 AM 78561 in reply to 78538

    Re: How can I insert a pdf page in a pdf page

    Hi,

    Thank you for considering Aspose.

    You can insert pages in a Pdf file using PdfFileEditor class. But I don't think you still got the header and footer and page numbering in a sequence. I will discuss this with the developers and we will let you know if we are supporting it or not. To insert pages in Pdf file, please refer to :

    http://www.aspose.com/Wiki/default.aspx/Aspose.Pdf.Kit/InsertPagesintoPDFDocument.html

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  05-30-2007, 9:42 AM 78566 in reply to 78538

    Re: How can I insert a pdf page in a pdf page

    Hi,

    Could you please send your PDF template to georgie.yuan@aspose.com or post to the forum as attachment?

    Georgie Yuan
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  06-04-2007, 10:25 AM 79193 in reply to 78566

    Re: How can I insert a pdf page in a pdf page

    Hi Aspose,

    I've send what you asked for to 'georgie.yuan@aspose.com' but I didn't receve an answer. See mail below.

    Jaco Rebel

    ===========

    Dear Georgie Yuan

    You wrote: Could you please send your PDF template to georgie.yuan@aspose.com or post to the forum as attachment?

     

    I sent you two pdf files in a zipfile.

    The template and 'uittreksel7327DA108.pdf'.

    When you open the template, on page 3 you see a space where uittreksel7327DA108.pdf must fit in.

    (I've tried it with stamp, but I cannot resize 'uittreksel7327DA108.pdf' )

     

    Thanks.

    Jaco Rebel.

     
  •  06-04-2007, 12:33 PM 79221 in reply to 79193

    Re: How can I insert a pdf page in a pdf page

    Hi,

    Our developers are investigating this issue to find some solution. They will reply you soon.

    Thanks for patience.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  06-04-2007, 10:15 PM 79276 in reply to 79221

    Re: How can I insert a pdf page in a pdf page

    Hi,

    I'm sorry for the delayed reply. I'm regret to say that we could not fulfil your requirement to insert pages into Pdf with origin template, header, footer and PageNumber. But you can use PdfPageEditor and PdfFileStamp to fill a Pdf page to page 3's space. the code list here:

    PdfPageEditor editor = new PdfPageEditor();
    editor.BindPdf(TestPath + "src.pdf");
    //resizes the src Pdf file to (200, 200)
    Aspose.Pdf.Kit.PageSize pagesize = new Aspose.Pdf.Kit.PageSize(200, 200);
    editor.PageSize = pagesize;
    editor.Save(TestPath + "temp.pdf");

    Stamp stamp = new Stamp();
    stamp.BindPdf(TestPath + "temp.pdf", 1);
    //sets the origin position for stamping
    stamp.SetOrigin(100, 100);
    stamp.Pages = new int[1]{3};
    PdfFileStamp fileStamp = new PdfFileStamp(TestPath + "Template.pdf",
        TestPath + "result.pdf");
    fileStamp.AddStamp(stamp);

    fileStamp.Close();

    Georgie Yuan
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  06-05-2007, 2:49 PM 79445 in reply to 79276

    Re: How can I insert a pdf page in a pdf page

    Georgie Yuan,

    Thanks for your suggestion.

    Unfortunately it doesn't work.

    After your suggestion I tried the following:

    //Resize the insertPage

    PdfPageEditor pageEditor = new PdfPageEditor();

    pageEditor.BindPdf(insertFile);

    pageEditor.Zoom = (float)0.95;

    pageEditor.Save(resizedInsertFile);

    Stamp pdfFileStamp = new Stamp();

    pdfFileStamp.BindPdf(resizedInsertFile, 1);

    //Set origin

    pdfFileStamp.SetOrigin(100, 100);

    int[] page = { 1 };

    pdfFileStamp.Pages = page;

    PdfFileStamp stamper = new PdfFileStamp(inFile, outFile);

    stamper.AddStamp(pdfFileStamp);

    stamper.Close();

    =================

    Now I can zoom the inserted page. That's fine. That's what I want. However, I cannot Set the Origin with pdfFileStamp.SetOrigin  Nothing changes when I choose another values. What I want: I will change the position of the inserted and resized pdf page a little bit, so that it can be placed more in the centre of the new page.

    Thanks,

    Jaco Rebel

     

     
  •  06-07-2007, 7:25 PM 79864 in reply to 79445

    Re: How can I insert a pdf page in a pdf page

    Attachment: Present (inaccessible)
    Hi,

    We have fixed this bug, please try the attachment.

    Best Regards.

    Georgie Yuan
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  06-11-2007, 9:20 AM 80102 in reply to 79864

    Re: How can I insert a pdf page in a pdf page

    Georgie Yuan,

    Thanks for your suggestion.

    Unfortunately it doesn't do anything better than before.

    What I did:

    I removed  Aspose.Pdf.Kit.dll and Aspose.Pdf.Kit.xml  in C:\Program Files\Aspose\Aspose.Pdf.Kit\Bin\net2.0 and placed your newer ones

    After replacing I tried the following again:

    //Resize the insertPage

    PdfPageEditor pageEditor = new PdfPageEditor();

    pageEditor.BindPdf(insertFile);

    pageEditor.Zoom = (float)0.95;

    pageEditor.Save(resizedInsertFile);

    Stamp pdfFileStamp = new Stamp();

    pdfFileStamp.BindPdf(resizedInsertFile, 1);

    //Set origin

    pdfFileStamp.SetOrigin(100, 100);

    int[] page = { 1 };

    pdfFileStamp.Pages = page;

    PdfFileStamp stamper = new PdfFileStamp(inFile, outFile);

    stamper.AddStamp(pdfFileStamp);

    stamper.Close();

    =================

    pdfFileStamp.SetOrigin(100, 100); doesn't do anything, what value I used for SetOrigin.

    What I want: I will change the position of the inserted and resized pdf page a little bit, so that it can be placed more in the centre of the new page and I think I have to do that with SetOrigin.

    Thanks,

    Jaco Rebel

     
  •  06-11-2007, 12:42 PM 80132 in reply to 80102

    Re: How can I insert a pdf page in a pdf page

    Hi,

    I have checked SetOrigin() function with this new Dlls attached in this forum and found that it is working fine. To make sure that you are using the latest version of Aspose.Pdf.Kit. Do the following steps:

    1. Remove the Aspose.Pdf.Kit.dll from the references in the Solution explorer

    2. Add a reference -> Browse to the New Dll.

    3. Check the version of the dll by Right clicking it from the references in the Solution explorer. The version should have to be 2.5.2.0.

    Please try it again. Hope it will work.

    If you need more help, please do let us know.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  06-12-2007, 4:37 AM 80205 in reply to 80132

    Re: How can I insert a pdf page in a pdf page

    Adeel Ahmad,

    My reference was wrong indeed.

    I changed it the way you descibed it so clearly and now it works very fine.

    Thanks.

    Jaco Rebel.

     
View as RSS news feed in XML