Removing bookmarks from pdf

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  Re: Removing bookmarks from pdf

DynamicPDF CoreSuite for .NET (v5) Forum

 Apr 30 2009 6:46 AM
Hello.

I have been working a while with the merger and I really like it so far. I am using it to merge several documents into one big pdf document, while creating my own bookmarks (or outlines).

This has proven to be a successful process thus far, but now i have encountered pdf documents which have their own bookmarks included.

There are two outcomes of these documents, the first being that the pdf is simply merged successfully into the big document, while adding the included bookmarks at the bottom of my own outline. The structure of the merging documents outline is intact but added at the bottom of the outlines..

The other outcome is a NullReferenceException, which i believe is due to a bookmark pointing at a page that simply does not exist.

Since I am creating my own outlines, I would like to remove or rather skip the merging of the bookmarks included in the pdf documents.

Is there anyway i can do this?
(using version 5.0)

Thanks in advance,
David
 Apr 30 2009 8:32 AM
Posted by a ceTe Software moderator
Hello David,

You can remove the bookmarks from an existing PDF document when merging the PDF using our product without any problem. Below is the sample code that shows how it can be done:

MergeOptions options = new MergeOptions( true );
options.Outlines = false;
// Create a merge document with your PDF containing bookmarks
MergeDocument document = new MergeDocument( @"C:\ImportPDF.pdf", options );
document.DrawToWeb(@"C:\MyDocument.pdf");

Thanks,
ceTe Software Support Team
 May 01 2009 4:15 AM
Seems to be working.. :)

thanks a lot.. :)
 May 01 2009 6:17 AM
Hello again..

it seems that i still get the NullReferenceException whenever i add the second document.. this is a document that has bookmarks, and all pages within the document are landscape pages..

I've done the MergeOptions with Outlines = false, but i still get the error, so i manually tried to alter the document where i removed the bookmarks manually, and now it's working..

this, however, is not a good solution as removing the bookmarks from the pdf manually takes too long..

i am going to try with version 5.1, but i am not sure there is any difference, so could anybody help please..

here is the stacktrace:
-------------------------------
System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="ceTe.DynamicPDF.20"
  StackTrace:
       at ceTe.DynamicPDF.Forms.Form.a(DocumentWriter A_0, kt A_1)
       at zz93.g7.a(DocumentWriter A_0)
       at ceTe.DynamicPDF.Forms.FormField.Draw(DocumentWriter writer)
       at ceTe.DynamicPDF.IO.DocumentResourceList.a(DocumentWriter A_0)
       at zz93.aj.x()
       at ceTe.DynamicPDF.Document.Draw(Stream stream)
---------------------------------

Thanks a lot in advance,
David
 May 01 2009 6:33 AM
if it's any interest the bookmarks in the document that aren't working have some really "messed" up names..

like
=S01
1 (+.B-X11.6.1)

there are also a lot of single character bookmarks like A, 1, 2 etc.

if there is anything i can do, let me know..
-David
 May 01 2009 8:56 AM
Posted by a ceTe Software moderator
Hello David,

Can you please send over the PDF document that is throwing the error to our Support Team so that they can investigate this behavior further?

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 11:15 PM.