Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit?

Last post 09-04-2011, 8:35 AM by codewarior. 7 replies.
Sort Posts: Previous Next
  •  08-24-2011, 9:42 PM 324406

    Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit? .NET

    Hello,

    We got a requirement from our client that when doing two-sided print pdf file, some specific pages should be at the front page, for example, the cover of appendix. So I want to know if there exists an approach to achieve this goal.I suppose such an approach: place some specific text in the pages of Word, convert it to Pdf, search these text and get the Page number, then make decision according to the number: if the number is odd,skip, otherwise,insert a blank page before this page. Does Aspose.Pdf.Kit support it or provide any methods to achieve it? Thanks.
    Filed under: aspose.pdf.Kit
     
  •  08-26-2011, 4:51 AM 324730 in reply to 324406

    Re: Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit?

    Hi Sheng,

    Please find the answer to your questions below:

    Yesheng:

    I suppose such an approach: place some specific text in the pages of Word, convert it to Pdf,


    You can use Aspose.Words for .NET in order to create Word documents and then convert them to PDF.

    Yesheng:

    search these text and get the Page number, then make decision according to the number:


    Aspose.Pdf for .NET allows you to search particular text and returns the related information. You may also keep track of the related pages at your end. For example, when you loop through the pages and search text in each page, you can keep record of the page number in which you find the text.

    Yesheng:

    if the number is odd,skip, otherwise,insert a blank page before this page.


    You may insert an empty page at a particular location (page number) in the PDF file.

    Yesheng:
    We got a requirement from our client that when doing two-sided print pdf file, some specific pages should be at the front page, for example, the cover of appendix.


    You can also send a whole PDF to printer using Aspose.Pdf for .NET. Also, as I shared the details in reply to your other questions,  you can organize the pages in the PDF before sending it to the printer. However, when the PDF is sent to the printer, it is sent as a whole and all the pages are printed in a sequence.

    I hope this helps. If you find any further questions, please do let us know.
    Regards,

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  08-26-2011, 7:59 AM 324768 in reply to 324730

    Re: Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit?

    Thank you for your reply. Yesterday I came up with an approach that using Word Section break (Odd/Even page) to add extra blank page by Word itself, then convert it to pdf by Aspose.Pdf.Kit. But unfortunately, the result of Word looked fine, but after calling PdfFileEditor.Concatenate method to concatenate other pdf files, the extra blank pages added automatically by Word were removed :( So could we reserve those extra blank pages during concatenating? Thanks.

     
  •  08-28-2011, 9:05 PM 324903 in reply to 324768

    Re: Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit?

    Hi Sheng,

    Thanks for sharing the details.

    As far as I have understood, you have been able to create word documents, able to insert blank pages using Word section break approach and convert these word files into PDF format. However when you concatenated the resultant PDF documents, the final merged document did not include the blank pages ? If so is the case, can you please share some sample PDF documents (with blank pages) so that we can test the scenario at our end. We apologize for your inconvenience.

    However concerning to your query "So could we reserve those extra blank pages during concatenating? " Can you please share some details regarding this requirement.

    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  08-30-2011, 2:23 AM 325177 in reply to 324903

    Re: Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit? .NET

    Attachment: Present (inaccessible)
    Hi,
    I uploaded two files: the Word documents has 43 pages totally, including several blank pages before every cover of Appendix (A1,A2,A3,A4 and A5). These blank pages were added by Word automatically after I set section break (even page) before those appendix covers. And during converting and merging, I inserted a two-page pdf file into the uploaded pdf file. You can see the landscope pages in it. But in the pdf, there are only 40 pages and those blank pages in Word are removed. And I also found a strange thing: during debugging, I called document.PageCount property to see the page count of Word Document, I saw the number was 42, but it should be 43...
     
  •  08-30-2011, 10:27 PM 325384 in reply to 325177

    Re: Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit?

    Additionally, I converted that 43 pages Word doc to pdf during debugging, and saved it in a temp folder:
     Document doc = new Document(ByteArrayName);
    doc.save("d:\ABC.pdf");

    Because doc.PageCount I got was 42, in the generated pdf only had 42 pages. The blank page before A1 cover is missing. It's strange.
     
  •  08-31-2011, 7:31 AM 325542 in reply to 325384

    Re: Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit?

    Hi,

    I have solved this problem now. Thanks.

     
  •  09-04-2011, 8:35 AM 326586 in reply to 325542

    Re: Could We Find a Specific Page in a Pdf File Using Aspose.Pdf.Kit?

    Hi Sheng,

    Thanks for using our products.

    I am glad to hear that your problem is fixed. In case you still face any problem or you have any further query, please feel free to contact.

    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML