Hi IText:

I am facing an issue in splitting pdf file.

The file splits successfully. but there is a small issue.
When i split the PDF file , all links work fine except those links whose
target(destination) are not in the split file.
Actually i am reading these links in SWTools(pdf2swf). It returns the
correct page numbers against all the links whose target are in the split
file and returns 0 whose destination are not the part of the split file.

So I just want a way to get the actual page number against those links whose
target are not the part of the split file.

Here is the small piece of code i am using

public static void splitPDFFile(String fileName)  {
        try {
            PdfReader reader = new PdfReader(fileName);
             int totalPages = reader.getNumberOfPages();
            System.out.println("There are total " + totalPages + " pages in
this input file\n");
            int splitPage = 10;
            String outFile="c:\\temp\\output.pdf";

                Document document = new
Document(reader.getPageSizeWithRotation(1));
                PdfCopy writer = new PdfCopy(document, new
FileOutputStream(outFile));
                document.open();


                for (int i = 1; i <= splitPage; i++) {
                    PdfImportedPage page = writer.getImportedPage(reader,i);
                    writer.addPage(page);

                }

                document.close();
                writer.close();




        } catch (Exception e) {
            e.printStackTrace();
        }
    }


Thanks in Advance
Regards,
Vajahat Ali
Softinn
Lahore Pakistan
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to