PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 12:55 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Oct 19, 2006 11:01 pm 
Offline

Joined: Thu Oct 19, 2006 10:56 pm
Posts: 2
Location: USA
I was testing this library out and was trying to bookmark and concatenate existing pdf documents. I would append a pdf document ok but when I try to save after adding the bookmarks for the existing pdfs I would get the debugger error "External object detected!". I followed the debug and it took me to a procedure called TransitiveClosureImplementation. Supposedly I referenced an external object. Any ideas on what this might mean? Thanks a million!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 23, 2006 8:27 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
This is assertion failure and what this really means is hard to explain. Abridged version: You found a bug in PDFsharp. As a quick workaround you should try to remove the assertion, maybe it is wrong.
However, it should not be raised. But I cannot fix it without getting it. Can you send me a short peace of code with a PDF file that triggers the assertion failure?

Regards
Stefan Lange


Top
 Profile  
Reply with quote  
 Post subject: Figured It Out
PostPosted: Tue Oct 24, 2006 5:23 pm 
Offline

Joined: Thu Oct 19, 2006 10:56 pm
Posts: 2
Location: USA
I found the solution to my problem after studying the AddPage function a bit more. The function says that the returned page is not the same object as the specified one. I was adding the PdfPage "page" as a bookmark but what I really needed to do was declare another handle ("page2" in the code below) and add that as the bookmark.

// *** GOOD ***
for (int idx = 0; idx < count; idx++)
{
page = inputDocument.Pages[idx];
PdfPage page2;
page2 = outputDocument.AddPage(page);
outline.Outlines.Add("SomeValue", page2, true);
}


------------------------------------------------------------------


// *** DOES NOT WORK & RAISES ERROR ***
for (int idx = 0; idx < count; idx++)
{
page = inputDocument.Pages[idx];
outputDocument.AddPage(page);
outline.Outlines.Add("SomeValue", page, true);
}



Thanks for responding to my post! This seems like a great project!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 12:22 am 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
Hello

Yes, you are right, this was the problem.

Now I check the parameters more precisely. I throw an exception immediately if someone adds a page to an outline that does not belong to the current document.

Regards
Stefan Lange


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 03, 2009 8:19 pm 
Offline

Joined: Thu Jul 02, 2009 8:13 pm
Posts: 5
hey, Im having a heck of a time trying to figure out how to add bookmarks to existing documents. Would you be able to post your some more code relating to this?

thanks,


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 400 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group