Actually, I was trying to do it in an old project that uses PDFBox 1.8.16 and it was failing, so I switched over to 2.0.25 and it worked much better... If I need help doing it in the former would you be able to provide support, or is it too late for that?
On Tue, Mar 15, 2022 at 5:14 AM Tilman Hausherr <thaush...@t-online.de> wrote: > Please upload the file "before" and "after" somewhere, and add load and > save code so we can have a look what happens > > Tilman > > Am 15.03.2022 um 00:21 schrieb Gilad Denneboom: > > It's been quite a while since I posted this question, and this issue > still > > doesn't have a clear answer, as far as I can see... > > Any new thoughts on the matter? > > > > On Tue, Nov 20, 2012 at 8:21 PM Gilad Denneboom < > gilad.denneb...@gmail.com> > > wrote: > > > >> Hi people, > >> > >> Another query here... I'm trying to add a new named destination to a > file, > >> but for some reason it doesn't show up... > >> > >> Here's the relevant piece of code I'm using for it: > >> > >> PDDestinationNameTreeNode dests = > >> doc.getDocumentCatalog().getNames().getDests(); > >> > >> PDPageXYZDestination d = new PDPageXYZDestination(); > >> d.setLeft(500); > >> d.setTop(500); > >> d.setPageNumber(0); > >> > >> Map<String, Object> destList = dests.getNames(); > >> Map<String, COSObjectable> newList = new HashMap<String, > >> COSObjectable>(); > >> > >> Iterator<String> it = destList.keySet().iterator(); > >> while(it.hasNext()) { > >> String key = it.next(); > >> System.out.println(key); > >> System.out.println(destList.get(key)); > >> newList.put(key, (COSObjectable)destList.get(key)); > >> } > >> newList.put("1", d); > >> dests.setNames(newList); > >> > >> Does anyone see any obvious problems, or am I going at it the wrong way? > >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org > For additional commands, e-mail: users-h...@pdfbox.apache.org > >