View previous topic :: View next topic |
Author |
Message |
Flecto
Joined: 03 Jun 2008 Posts: 1
|
Posted: Tue Jun 03, 2008 3:21 pm Post subject: ScanHexadecimalString gets stuck in an infinite loop |
|
|
The opening angle brackets of the follwoing subdictionary
Code: | <</Predictor 15
/Columns 8
/Colors 3>> |
inside a content stream are falsely interpreted as the beginning of hexdecimal number. The result is that ScanHexadecimalString() of CLexer gets stuck in an infinite loop.
A possible solution to this problem might be to check at the beginning of ScanHexadecimalString() whether the NextChar is also '<'. If that's the case, ScanHexadecimalString() shouldn't continue. |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Wed Jun 04, 2008 7:49 am Post subject: |
|
|
That bug will be fixed with the next release (which is scheduled for summer 2008). _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Tue Nov 25, 2008 8:49 pm Post subject: |
|
|
Is there a fix for this issue? I took it upon myself to basically reinvent the wheel as far as paring content streams, but I'd rather not rely on regular expressions to do all my heavy lifting. Thanks. |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Wed Nov 26, 2008 12:19 pm Post subject: |
|
|
If this issue still occurs with PDFsharp 1.20 published June 24, 2008 then please provide us a PDF file that allows us to replicate the issue. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Wed Nov 26, 2008 1:45 pm Post subject: |
|
|
Gladly. 140.pdf |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Thu Nov 27, 2008 8:18 am Post subject: |
|
|
Hi!
I tested that file with PdfSharp.Explorer and with the TwoPagesOnOne sample - no endless loop.
I cannot replicate this problem with PDFsharp 1.20 published June 24, 2008.
When does this endless loop occur? _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Mon Dec 01, 2008 5:44 pm Post subject: |
|
|
When using the ContentReader.ReadContent function, 100% of the time I end up stuck in the ScanHexadecimalString function with the current character always being "<" and the position never advances.
Here's some sample VB code to show you how I get stuck in the loop.
Code: |
Sub Main()
Dim doc As PdfDocument = PdfReader.Open("140.pdf")
For Each page As PdfPage In doc.Pages
Dim cseq As CSequence = ContentReader.ReadContent(page)
Console.WriteLine("This message will not show.")
Next
doc.Close()
End Sub
|
I realize that this code doesn't really accomplish anything, but if you run it you will never get it to output to the console because its stuck in ScanHexadecimalString.
I hope that helps out some and thanks again.
- B |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Wed Dec 17, 2008 3:50 pm Post subject: |
|
|
Hi Thomas, I was curious to know if you were able to reproduce the infinite loop I get based on the code I posted? |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Wed Jan 07, 2009 9:40 am Post subject: |
|
|
Yes, I was able to replicate the problem ...
... but because parsing PDF is not my area of expertise I had to forward it to a team member.
I'm back from holiday today. I'll check if the problem was solved. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Mon Jan 12, 2009 2:06 pm Post subject: |
|
|
Thanks Thomas. |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Thu Apr 09, 2009 1:42 pm Post subject: |
|
|
I'm just curious if any progress has been made towards fixing this bug. |
|
Back to top |
|
|
|