View previous topic :: View next topic |
Author |
Message |
SQLServerGeek
Joined: 19 Oct 2006 Posts: 2 Location: USA
|
Posted: Thu Oct 19, 2006 11:01 pm Post subject: "External object detected!" error |
|
|
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! |
|
Back to top |
|
 |
Stefan Lange

Joined: 12 Oct 2006 Posts: 47 Location: Cologne, Germany
|
Posted: Mon Oct 23, 2006 8:27 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
SQLServerGeek
Joined: 19 Oct 2006 Posts: 2 Location: USA
|
Posted: Tue Oct 24, 2006 5:23 pm Post subject: Figured It Out |
|
|
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! |
|
Back to top |
|
 |
Stefan Lange

Joined: 12 Oct 2006 Posts: 47 Location: Cologne, Germany
|
Posted: Mon Oct 30, 2006 12:22 am Post subject: |
|
|
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 |
|
Back to top |
|
 |
|