php와 drupal을 사용하여 pdf를 텍스트로 변환 (pdf to text convert using php and drupal)


문제 설명

php와 drupal을 사용하여 pdf를 텍스트로 변환 (pdf to text convert using php and drupal)

pdf를 텍스트로 변환하기 위해 이 코드를 사용하고 있습니다. 제대로 작동하지만 지원하지 않습니다. 스웨덴 문자, 예:

correect swedish word     = incorrect word    
Förnamn                   = Fšrnamn,
Försäljningsdatum         = FšrsŠljningsdatum,
varumärket                = varumŠrket,
terförsäljaruppgifter     = terfšrsŠljaruppgifter

코드:

<?php
    require_once "pdf.pdf2text.inc";
    $filename = "customerfile.pdf";
    $pdf = new Pdf(urldecode($filename));
    print utf8_decode($pdf‑>getText());//with utf‑8
    print $pdf‑>getText(); //without utf‑8
?>

utf‑8 인코딩/디코딩을 추가했지만 작동하지 않습니다. 이 코드 사용

누군가 나를 도와주거나 적절한 텍스트(단어 ) 이 코드를 사용합니다.

미리 감사합니다.


참조 솔루션

방법 1:

iconv(); might be a possibility http://php.net/manual/fr/function.utf8‑decode.php

$myUnicodeString = "Åäö"; echo iconv("UTF‑8", "ISO‑8859‑1", $myUnicodeString); as some comments say UTF‑8_decode(); is not enough to handle accents.

According to a comment on Drupal.org from Saubhagya:

add the octal and unicode equivalents of desired characters in array $_pdfDocToUni line 18 file initialize.pdf2text.inc (remember octal need to be in 3 digits as in other entries of array).

Then just go to line 335 of pdf2text.module and add your character in the same format of other ones.

https://www.drupal.org/node/1079780

Not sure about the use of the word "just" but it might be a help...

This appears to be the module he is talking about and it does have the array he mentioned ‑ perhaps your version may have modules missing ‑ there seem to be a lot of them on offer

http://cgit.drupalcode.org/pdf2text/tree/pdf2text.module?id=a15059bc1531aa336fef255397ba362c81c9fce5

(by AshokSteve)

참조 문서

  1. pdf to text convert using php and drupal (CC BY‑SA 2.5/3.0/4.0)

#PHP #drupal #pdftotext #Github #shared-libraries






관련 질문

bash의 rsync가 php 생성 --exclude-from 파일을 구문 분석하지 않음 (rsync in bash not parsing php-generated --exclude-from file)

PHP 배열 값 저장 (PHP Save array value)

검색으로 배열에서 특정 데이터 가져오기 (get specific datas from a array by a search)

창 서비스를 사용하여 PHP 파일 트리거 (Trigger a php file using window service)

yii2 컨트롤러 작업 주입은 어떻게 작동합니까? (How does the yii2 Controller action injection works)

php와 drupal을 사용하여 pdf를 텍스트로 변환 (pdf to text convert using php and drupal)

PHP에서 카테고리 및 하위 카테고리 목록 검색 (Retrieve Category & Subcategory list in PHP)

PDO - COUNT(*) 결과를 얻습니까? (PDO - get the result of a COUNT(*)?)

PHP - MySQL 쿼리 문제 (PHP - Mysql query problem)

제품용 Reviews.io API의 Foreach 루프 (Foreach loop in Reviews.io API for Products)

숫자를 나누고 점 뒤에 하나의 숫자를 유지하십시오. (Split the number and keep one number after the dot)

내 메시지 입력이 데이터베이스에 들어가지 않습니다. (My message input doesn't get into database)







코멘트