Giter Site home page Giter Site logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024

Original comment by [email protected] on 28 May 2014 at 6:02

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024

Original comment by [email protected] on 2 Jun 2014 at 11:05

  • Changed state: Started

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024

Original comment by [email protected] on 2 Jun 2014 at 11:06

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
This is caused by trailing '\0' in url and affecting other pdf with text link. 
Should change pdfium_page.cc, line 410 to

     for (size_t j = 0; j < link.url.length()-1; ++j)

John, please confirm and commit this, thanks!

Original comment by [email protected] on 3 Jun 2014 at 7:29

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
ah, this is a regression. sample files that I have used to work, but not 
anymore. It looks like we're adding the null terminator when we create a string 
from the result of FPDFLink_GetURL, which per documentation it doesn't include. 
Not sure how this worked before.

Original comment by [email protected] on 5 Jun 2014 at 6:06

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
Bo: I looked into this more, and I believe the problem is in fpdftext.cpp.
FPDFLink_GetURL says it returns the number of chracters excluding the 
terminator. However the implementation converts from a CFX_WideString (with 
length not including terminating null) to a CFX_ByteString. That conversion 
adds a null terminator to the length, since CFX_WideString::UTF16LE_Encode has 
a default parameter of bTerminate=true.

Original comment by [email protected] on 6 Jun 2014 at 1:39

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
John, the comments for FPDFLink_GetURL says "If buffer is NULL or buflen is 
zero, return number of characters (not bytes and an additional terminator is 
also counted) needed", so in pdfium_page.cc:390, 394, the url_length should 
already include the terminator.

Going down, pdfium_page.cc:410 link.url.length() also includes the terminator. 
In this regard, fpdftext.cpp should be ok.

Original comment by [email protected] on 6 Jun 2014 at 2:19

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
Hi Bo, I was going by 
http://tickets.foxitsoftware.com/support/usermanuals/DLL311/group___f_p_d_f_t_e_
x_t.html#ga250c31057dcc3277e9f56e870e690c58. I guess that's outdated since it 
doesn't mention that? I now see that the header in pdfium's repo says 
otherwise, so I'll go with that instead.

Original comment by [email protected] on 6 Jun 2014 at 3:01

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
That document is indeed outdated, thanks for pointing out.

Original comment by [email protected] on 6 Jun 2014 at 4:22

from pdfium.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024

Original comment by [email protected] on 6 Jun 2014 at 2:42

  • Changed state: Fixed

from pdfium.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.