Hi,
I tried different ways, but it didn´t find a working solution. I like to read the existing bookmarks, memorize them, delete from the original document and after that to concernate the mypdf.pdf with some other pdf. But when I try to tead fn into the stream I got an error that fn is used by another procces. editor.save(fn) allready cause an error.
What is the right way to do this? The best for me would to use a filestream (FileAccess.ReadWrite) for the whole operation. but the error was the same.
My last code...
Thanks, Daniel
friend sub(byRef thisbookmark as Aspose.Pdf.Kit.BookMark,byval pagescount as integer)
dim fn as String ="c:\mypdf.pdf"
Dim editor As New PdfBookmarkEditor
editor.bind(fn)
try
Dim thisbookmarkcollection As New Aspose.Pdf.Kit.Bookmarks
thisbookmarkcollection = editor.ExtractBookmarks()
For Each bookmark As Aspose.Pdf.Kit.Bookmark In thisbookmarkcollection
bookmark.Action = "GoTo"
bookmark.PageNumber = pagescount + bookmark.PageNumber
Next bookmark
thisbookmark.ChildItem = thisbookmarkcollection
editor.DeleteBookmarks()
editor.Save(FN)
editor = nothing
catch
editor = nothing
end try
Dim myStream As FileStream = New FileStream(FN, FileMode.Open, FileAccess.Read)
If myStream.CanRead Then
add2ExportObject(myStream, FN)
end if
end sub