Hello Paulo, after struggle, We have been successful to merge 3G original pdf files to a single one in the linux 64bit system. Unfortunately, when we open this huge merged file, there is an error thrown out: “there is an internal error, it’s being repared”, and then we have to wait for a While, maybe 8 minutes, the huge file can be opened. However, for the other merged files, which are smaller or bigger 2G, they can be opened without any error occurs.
btw, when we do the merging task, the peak of the memory usage is 14G, I don't know why so much memory was used. cheers, davy lee Paulo Soares wrote: > > Curiously there's not that much rewrite to atain this goal although it's > probably a week worth of work. File pointers must be changed to 64 bit, > the page tree and the xref table must be kept in file. The last item is > in the to-do list (http://itext.ugent.be/library/todo.php?id=7). > > Paulo > >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On >> Behalf Of Leonard Rosenthol >> Sent: Tuesday, December 19, 2006 1:43 PM >> To: Post all your questions about iText here >> Cc: Davy Lee >> Subject: Re: [iText-questions] How to merge two 3G size pdf fast >> >> If "iText is the only option for us in our project", then you are >> going to need to rewrite major parts of iText to perform the merge >> operations WITHOUT keeping things in memory as it goes. in >> addition, >> you will need to ensure the 32bit requirements of PDF, especially if >> creating PDFs with version <=1.4. >> >> Leonard >> >> On Dec 19, 2006, at 8:26 AM, Davy Lee wrote: >> >> > >> > Leonard, >> > We have to merge the ducument in our project according to >> the client's >> > requirements, >> > other than Adobe Acrobat 7 or later. And the huge pdf file could >> > be merged >> > by lots of >> > small pdf files. However, even by this way, when the merged >> file is >> > more >> > than my physical >> > memory, it throws out something like "no enough memory for heap". >> > >> > We are going to merge a lot of small pdf files to a single >> one. The >> > itext is >> > the only option for >> > us in our project, Coz we need the API libary, other than an >> > application. >> > >> > cheers, >> > Davy Lee. >> > >> > >> > >> > Leonard Rosenthol wrote: >> >> >> >> The ONLY program that I know of that will merge documents >> that large >> >> is Adobe Acrobat 7 or later. >> >> >> >> Also, can you explain what sort of documents you are >> merging? Is it >> >> possible that Acrobat 8's new "Package" feature would be a better >> >> solution for you? >> >> >> >> Leonard >> >> >> >> On Dec 19, 2006, at 3:49 AM, Davy Lee wrote: >> >> >> >>> >> >>> unfortunately, our client really need to merge a 2G or 3G pdf >> >>> file, it would >> >>> be at least 2G. >> >>> any body can give me some hints to modify the ITEXT or >> find another >> >>> API? >> >>> thanks so much.. >> >>> >> >>> cheers, >> >>> Davy lee >> >>> >> >>> >> >>> Robert Engels wrote: >> >>>> >> >>>> iText uses a memory mapped file. You may not enough enough >> >>>> contigiuos >> >>>> address space to map a file that large. >> >>>> >> >>>> iText needs to be changed to support a simple >> RandomAccessFile and >> >>>> then it would work. >> >>>> >> >>>> Doesn't matter anyway, since two 1.6 gig files would be larger >> >>>> than 2 >> >>>> gig... >> >>>> >> >>>> >> >>>> On Dec 18, 2006, at 3:43 AM, Davy Lee wrote: >> >>>> >> >>>>> >> >>>>> When I tried to process two 1.6G pdf file, an error occured: >> >>>>> >> >>>>> java.io.IOException: Not enough storage is available to process >> >>>>> this command >> >>>>> at sun.nio.ch.FileChannelImpl.map0(Native Method) >> >>>>> at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java: >> >>>>> 742) >> >>>>> at >> >>>>> com.lowagie.text.pdf.MappedRandomAccessFile.init >> >>>>> (MappedRandomAccessFile.java:103) >> >>>>> at >> >>>>> com.lowagie.text.pdf.MappedRandomAccessFile.<init> >> >>>>> (MappedRandomAccessFile.java:87) >> >>>>> at >> >>>>> com.lowagie.text.pdf.RandomAccessFileOrArray.<init> >> >>>>> (RandomAccessFileOrArray.java:121) >> >>>>> at >> >>>>> com.lowagie.text.pdf.RandomAccessFileOrArray.<init> >> >>>>> (RandomAccessFileOrArray.java:80) >> >>>>> at com.lowagie.text.pdf.PRTokeniser.<init> >> >>>>> (PRTokeniser.java: >> >>>>> 108) >> >>>>> at >> com.lowagie.text.pdf.PdfReader.<init>(PdfReader.java: >> >>>>> 155) >> >>>>> at >> com.lowagie.text.pdf.PdfReader.<init>(PdfReader.java: >> >>>>> 145) >> >>>>> at sticker.Main.main(Main.java:60) >> >>>>> >> >>>>> >> >>>>> it means that the error occured at : >> >>>>> reader = new PdfReader(new RandomAccessFileOrArray(fileList >> >>>>> [docNum]), >> >>>>> null); >> >>>>> >> >>>>> however, in the book "ITEXT in action" said: using new >> >>>>> RandomAccessFileOrArray(fileList[docNum]) >> >>>>> in the pdfreader constructor will partial read the >> original file, >> >>>>> I'm >> >>>>> confusing. >> >>>>> >> >>>>> if the error occurs in the pdfReader constructor, it >> will be still >> >>>>> no useful >> >>>>> to rewrite the pdfcopy class or >> >>>>> the pdfwriter class. >> >>>>> >> >>>>> cheers, >> >>>>> Davy Lee >> >>>>> >> >>>>> >> >>>>> >> >>>>> >> >>>>> Paulo Soares wrote: >> >>>>>> >> >>>>>> The total size of the file can't be 2G so it would be >> like two 1G >> >>>>>> files. >> >>>>>> Doing this will always take a lot of time and a lot of memory >> >>>>>> unless the >> >>>>>> number of pages is small. To merge such big files efficiently >> >>>>>> you'd have >> >>>>>> to >> >>>>>> create a customized PdfCopy. >> >>>>>> >> >>>>>> Paulo >> >>>>>> >> >>>>>> ----- Original Message ----- >> >>>>>> From: "Davy Lee" <[EMAIL PROTECTED]> >> >>>>>> To: <[email protected]> >> >>>>>> Sent: Monday, December 18, 2006 8:31 AM >> >>>>>> Subject: Re: [iText-questions] How to merge two 3G >> size pdf fast >> >>>>>> >> >>>>>> >> >>>>>>> >> >>>>>>> Dear Paulo, >> >>>>>>> even for two 2G pdf file, do u have a better sosution to merge >> >>>>>>> them, >> >>>>>>> sometimes I don't need to modify the pages, sometime I do. >> >>>>>>> cheers. >> >>>>>>> >> >>>>>>> Davy lee >> >>>>>>> >> >>>>>>> >> >>>>>>> Paulo Soares wrote: >> >>>>>>>> >> >>>>>>>> You'll certainly won't use iText to do this. iText has a 2G >> >>>>>>>> size >> >>>>>>>> limitation. >> >>>>>>>> >> >>>>>>>> Paulo >> >>>>>>>> >> >>>>>>>> ----- Original Message ----- >> >>>>>>>> From: "Davy Lee" <[EMAIL PROTECTED]> >> >>>>>>>> To: <[email protected]> >> >>>>>>>> Sent: Monday, December 18, 2006 4:11 AM >> >>>>>>>> Subject: [iText-questions] How to merge two 3G size pdf fast >> >>>>>>>> >> >>>>>>>> >> >>>>>>>>> >> >>>>>>>>> I have two 3G size pdf files, we need to use ITEXT to merge >> >>>>>>>>> them into >> >>>>>>>>> one >> >>>>>>>>> single new pdf document. >> >>>>>>>>> However, to do this will waste too much time to finished >> >>>>>>>>> it. It >> >>>>>>>>> would >> >>>>>>>>> cost >> >>>>>>>>> us about half days to finish >> >>>>>>>>> to merging process. Do u guys have any new solution >> to do it? >> >>>>>>>>> cheers. >> >>>>>>>>> My code is below: >> >>>>>>>>> >> >>>>>>>>> //pdf files array list. >> >>>>>>>>> String [] fileList = {"sample1.pdf","sample2.pdf"}; >> >>>>>>>>> >> >>>>>>>>> Document document; >> >>>>>>>>> PdfCopy copy; >> >>>>>>>>> PdfReader reader; >> >>>>>>>>> >> >>>>>>>>> try >> >>>>>>>>> { // step 1 >> >>>>>>>>> document = new Document(); >> >>>>>>>>> // step 2 >> >>>>>>>>> copy = new PdfCopy(document, new >> FileOutputStream( >> >>>>>>>>> "sample_Combination.pdf")); >> >>>>>>>>> // step 3 >> >>>>>>>>> document.open(); >> >>>>>>>>> for(int docNum=0; >> docNum<fileList.length;docNum++) >> >>>>>>>>> { >> >>>>>>>>> reader = new PdfReader(new >> >>>>>>>>> RandomAccessFileOrArray(fileList[docNum]), null); >> >>>>>>>>> int pages = reader.getNumberOfPages(); >> >>>>>>>>> // step 4 >> >>>>>>>>> for (int pageNum = 0; pageNum < pages; ) >> >>>>>>>>> { >> >>>>>>>>> ++pageNum; >> >>>>>>>>> copy.addPage(copy.getImportedPage(reader, >> >>>>>>>>> pageNum)); >> >>>>>>>>> }//iterate page loop. >> >>>>>>>>> }// iterate doc loop. >> >>>>>>>>> >> >>>>>>>>> // step 5 >> >>>>>>>>> document.close(); >> >>>>>>>>> >> >>>>>>>>> >> >>>>>>>>> >> >>>>>>>>> } >> >>>>>>>>> catch(IOException e) >> >>>>>>>>> { >> >>>>>>>>> e.printStackTrace(); >> >>>>>>>>> } >> >>>>>>>>> catch (DocumentException e) >> >>>>>>>>> { >> >>>>>>>>> e.printStackTrace(); >> >>>>>>>>> } >> >>>>>>>>> >> >>>>>>>>> very big thanks in advance. >> >>>>>>>>> -- >> >>>>>>>>> View this message in context: >> >>>>>>>>> http://www.nabble.com/How-to-merge-two-3G-size-pdf-fast- >> >>>>>>>>> tf2837983.html#a7923347 >> >>>>>>>>> Sent from the iText - General mailing list archive at >> >>>>>>>>> Nabble.com. >> >>>>>>>>> >> >>>>>>>>> >> >>>>>>>>> >> -------------------------------------------------------------- >> >>>>>>>>> -- >> >>>>>>>>> -- >> >>>>>>>>> ------- >> >>>>>>>>> Take Surveys. Earn Cash. Influence the Future of IT >> >>>>>>>>> Join SourceForge.net's Techsay panel and you'll get >> the chance >> >>>>>>>>> to share >> >>>>>>>>> your >> >>>>>>>>> opinions on IT & business topics through brief surveys - and >> >>>>>>>>> earn cash >> >>>>>>>>> http://www.techsay.com/default.php? >> >>>>>>>>> page=join.php&p=sourceforge&CID=DEVDEV >> >>>>>>>>> _______________________________________________ >> >>>>>>>>> iText-questions mailing list >> >>>>>>>>> [email protected] >> >>>>>>>>> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >>>>>>>>> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >>>>>>>> >> >>>>>>>> >> >>>>>>>> >> --------------------------------------------------------------- >> >>>>>>>> -- >> >>>>>>>> -- >> >>>>>>>> ------ >> >>>>>>>> Take Surveys. Earn Cash. Influence the Future of IT >> >>>>>>>> Join SourceForge.net's Techsay panel and you'll get >> the chance >> >>>>>>>> to share >> >>>>>>>> your >> >>>>>>>> opinions on IT & business topics through brief surveys - and >> >>>>>>>> earn cash >> >>>>>>>> http://www.techsay.com/default.php? >> >>>>>>>> page=join.php&p=sourceforge&CID=DEVDEV >> >>>>>>>> _______________________________________________ >> >>>>>>>> iText-questions mailing list >> >>>>>>>> [email protected] >> >>>>>>>> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >>>>>>>> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >>>>>>>> >> >>>>>>>> >> >>>>>>> >> >>>>>>> -- >> >>>>>>> View this message in context: >> >>>>>>> http://www.nabble.com/How-to-merge-two-3G-size-pdf-fast- >> >>>>>>> tf2837983.html#a7925099 >> >>>>>>> Sent from the iText - General mailing list archive at >> >>>>>>> Nabble.com. >> >>>>>>> >> >>>>>>> >> >>>>>>> >> ---------------------------------------------------------------- >> >>>>>>> -- >> >>>>>>> -- >> >>>>>>> ----- >> >>>>>>> Take Surveys. Earn Cash. Influence the Future of IT >> >>>>>>> Join SourceForge.net's Techsay panel and you'll get the >> >>>>>>> chance to >> >>>>>>> share >> >>>>>>> your >> >>>>>>> opinions on IT & business topics through brief surveys - and >> >>>>>>> earn >> >>>>>>> cash >> >>>>>>> http://www.techsay.com/default.php? >> >>>>>>> page=join.php&p=sourceforge&CID=DEVDEV >> >>>>>>> _______________________________________________ >> >>>>>>> iText-questions mailing list >> >>>>>>> [email protected] >> >>>>>>> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >>>>>>> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >>>>>> >> >>>>>> >> >>>>>> >> ----------------------------------------------------------------- >> >>>>>> -- >> >>>>>> -- >> >>>>>> ---- >> >>>>>> Take Surveys. Earn Cash. Influence the Future of IT >> >>>>>> Join SourceForge.net's Techsay panel and you'll get >> the chance to >> >>>>>> share >> >>>>>> your >> >>>>>> opinions on IT & business topics through brief surveys >> - and earn >> >>>>>> cash >> >>>>>> http://www.techsay.com/default.php? >> >>>>>> page=join.php&p=sourceforge&CID=DEVDEV >> >>>>>> _______________________________________________ >> >>>>>> iText-questions mailing list >> >>>>>> [email protected] >> >>>>>> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >>>>>> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >>>>>> >> >>>>>> >> >>>>> >> >>>>> -- >> >>>>> View this message in context: >> http://www.nabble.com/How-to-merge- >> >>>>> two-3G-size-pdf-fast-tf2837983.html#a7925842 >> >>>>> Sent from the iText - General mailing list archive at >> Nabble.com. >> >>>>> >> >>>>> >> >>>>> >> ------------------------------------------------------------------ >> >>>>> -- >> >>>>> -- >> >>>>> --- >> >>>>> Take Surveys. Earn Cash. Influence the Future of IT >> >>>>> Join SourceForge.net's Techsay panel and you'll get the >> chance to >> >>>>> share your >> >>>>> opinions on IT & business topics through brief surveys >> - and earn >> >>>>> cash >> >>>>> http://www.techsay.com/default.php? >> >>>>> page=join.php&p=sourceforge&CID=DEVDEV >> >>>>> _______________________________________________ >> >>>>> iText-questions mailing list >> >>>>> [email protected] >> >>>>> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >>>>> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >>>> >> >>>> >> >>>> >> ------------------------------------------------------------------- >> >>>> -- >> >>>> ---- >> >>>> Take Surveys. Earn Cash. Influence the Future of IT >> >>>> Join SourceForge.net's Techsay panel and you'll get the chance to >> >>>> share >> >>>> your >> >>>> opinions on IT & business topics through brief surveys - and earn >> >>>> cash >> >>>> http://www.techsay.com/default.php? >> >>>> page=join.php&p=sourceforge&CID=DEVDEV >> >>>> _______________________________________________ >> >>>> iText-questions mailing list >> >>>> [email protected] >> >>>> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >>>> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >>>> >> >>>> >> >>> >> >>> -- >> >>> View this message in context: http://www.nabble.com/How-to-merge- >> >>> two-3G-size-pdf-fast-tf2837983.html#a7943588 >> >>> Sent from the iText - General mailing list archive at Nabble.com. >> >>> >> >>> >> >>> >> -------------------------------------------------------------------- >> >>> -- >> >>> --- >> >>> Take Surveys. Earn Cash. Influence the Future of IT >> >>> Join SourceForge.net's Techsay panel and you'll get the chance to >> >>> share your >> >>> opinions on IT & business topics through brief surveys - >> and earn >> >>> cash >> >>> http://www.techsay.com/default.php? >> >>> page=join.php&p=sourceforge&CID=DEVDEV >> >>> _______________________________________________ >> >>> iText-questions mailing list >> >>> [email protected] >> >>> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >>> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >>> >> >> >> >> >> >> >> --------------------------------------------------------------------- >> >> ---- >> >> Take Surveys. Earn Cash. Influence the Future of IT >> >> Join SourceForge.net's Techsay panel and you'll get the chance to >> >> share >> >> your >> >> opinions on IT & business topics through brief surveys - and earn >> >> cash >> >> http://www.techsay.com/default.php? >> >> page=join.php&p=sourceforge&CID=DEVDEV >> >> _______________________________________________ >> >> iText-questions mailing list >> >> [email protected] >> >> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> >> >> >> >> > >> > -- >> > View this message in context: http://www.nabble.com/How-to-merge- >> > two-3G-size-pdf-fast-tf2837983.html#a7946966 >> > Sent from the iText - General mailing list archive at Nabble.com. >> > >> > >> > >> -------------------------------------------------------------- >> -------- >> > --- >> > Take Surveys. Earn Cash. Influence the Future of IT >> > Join SourceForge.net's Techsay panel and you'll get the chance to >> > share your >> > opinions on IT & business topics through brief surveys - >> and earn cash >> > http://www.techsay.com/default.php? >> > page=join.php&p=sourceforge&CID=DEVDEV >> > _______________________________________________ >> > iText-questions mailing list >> > [email protected] >> > https://lists.sourceforge.net/lists/listinfo/itext-questions >> > Buy the iText book: http://itext.ugent.be/itext-in-action/ >> > >> >> >> -------------------------------------------------------------- >> ----------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the >> chance to share your >> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge >> &CID=DEVDEV >> _______________________________________________ >> iText-questions mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/itext-questions >> Buy the iText book: http://itext.ugent.be/itext-in-action/ >> > > > Aviso Legal: > Esta mensagem é destinada exclusivamente ao destinatário. Pode conter > informação confidencial ou legalmente protegida. A incorrecta transmissão > desta mensagem não significa a perca de confidencialidade. Se esta > mensagem for recebida por engano, por favor envie-a de volta para o > remetente e apague-a do seu sistema de imediato. É proibido a qualquer > pessoa que não o destinatário de usar, revelar ou distribuir qualquer > parte desta mensagem. > > Disclaimer: > This message is destined exclusively to the intended receiver. It may > contain confidential or legally protected information. The incorrect > transmission of this message does not mean the loss of its > confidentiality. If this message is received by mistake, please send it > back to the sender and delete it from your system immediately. It is > forbidden to any person who is not the intended receiver to use, > distribute or copy any part of this message. > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > Buy the iText book: http://itext.ugent.be/itext-in-action/ > > -- View this message in context: http://www.nabble.com/How-to-merge-two-3G-size-pdf-fast-tf2837983.html#a8251426 Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
