Feng Forum

Support => Feng Office 3 => : disconnect September 29, 2015, 12:01:57 PM

: Can't upload some PDF files
: disconnect September 29, 2015, 12:01:57 PM
Hi all

The strange problem occured. When I trying to upload PDF document created by Office 2010 the process takes a long time.

The document eventually uploaded to the server but the name changes to the "error.pdf"

I can rename it, but sure this is abnormal.

No error logs, no any warnings but very long and annoying.

Any idea what be wrong and how can I fix it?

Thank you in advance.

A little more

Xubuntu 12.04 Apache 2 php 5 Any other documents like a TXT, DOC, PDF from PDF printer or Adobe STD working fine.
: Re: Can't upload some PDF files
: disconnect September 30, 2015, 11:44:10 AM
Fixed.  Is a bug, for sure, just add a "_" in dirtytxt function and problem is gone.  If anyone get the same trouble, just ask me. "Thanks" for your help.
: Re: Can't upload some PDF files
: conrado October 22, 2015, 06:07:40 PM
Hi disconnect.

Thanks  (no quotation marks for you :P ) for following up on this.

I have taken note of this to pass to the dev team.

Did you put it in the issue tracking system? Sorry I ask and don't check - trying to cover as many questions/issues as possible with very little time. We are hard working on version 3.4 (It is looking so good already!)

Cheers!
: Re: Can't upload some PDF files
: disconnect December 16, 2015, 07:57:25 AM
Hi Conrado.

Sorry for long response

The problem here

:
}
function getDirtyTexts(&$texts, $textContainers) {
    for ($j = 0; $j < count($textContainers); $j++) {
        if (preg_match_all("#\[(.*)\]\s*TJ#ismU", $textContainers[$j], $parts))
            $texts = array_merge($texts, @$parts[1]);
        elseif(preg_match_all("#Td\s*(\(.*\))\s*Tj#ismU", $textContainers[$j], $parts))
            $texts = array_merge($texts, @$parts[1]);
    }

I just add "_" symbol in
:
#Td\s*(\(.*\))\s*Tj#ismU
Now it look like
:
_#Td\s*(\(.*\))\s*Tj#ismU
:
}
function getDirtyTexts(&$texts, $textContainers) {
    for ($j = 0; $j < count($textContainers); $j++) {
        if (preg_match_all("_#\[(.*)\]\s*TJ#ismU", $textContainers[$j], $parts))
            $texts = array_merge($texts, @$parts[1]);
        elseif(preg_match_all("_#Td\s*(\(.*\))\s*Tj#ismU", $textContainers[$j], $parts))
            $texts = array_merge($texts, @$parts[1]);
    }

And error is gone

Hope this helps.