1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @file This file is part of the PdfParser library. |
5
|
|
|
* |
6
|
|
|
* @author Konrad Abicht <[email protected]> |
7
|
|
|
* |
8
|
|
|
* @date 2020-06-01 |
9
|
|
|
* |
10
|
|
|
* @author Sébastien MALOT <[email protected]> |
11
|
|
|
* |
12
|
|
|
* @date 2017-01-03 |
13
|
|
|
* |
14
|
|
|
* @license LGPLv3 |
15
|
|
|
* |
16
|
|
|
* @url <https://github.com/smalot/pdfparser> |
17
|
|
|
* |
18
|
|
|
* PdfParser is a pdf library written in PHP, extraction oriented. |
19
|
|
|
* Copyright (C) 2017 - Sébastien MALOT <[email protected]> |
20
|
|
|
* |
21
|
|
|
* This program is free software: you can redistribute it and/or modify |
22
|
|
|
* it under the terms of the GNU Lesser General Public License as published by |
23
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
24
|
|
|
* (at your option) any later version. |
25
|
|
|
* |
26
|
|
|
* This program is distributed in the hope that it will be useful, |
27
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
28
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
29
|
|
|
* GNU Lesser General Public License for more details. |
30
|
|
|
* |
31
|
|
|
* You should have received a copy of the GNU Lesser General Public License |
32
|
|
|
* along with this program. |
33
|
|
|
* If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. |
34
|
|
|
*/ |
35
|
|
|
|
36
|
|
|
namespace PHPUnitTests\Integration; |
37
|
|
|
|
38
|
|
|
use PHPUnitTests\TestCase; |
39
|
|
|
use Smalot\PdfParser\Config; |
40
|
|
|
|
41
|
|
|
class ConfigTest extends TestCase |
42
|
|
|
{ |
43
|
|
|
public function testHorizontalOffset() |
44
|
|
|
{ |
45
|
|
|
$filename = $this->rootDir.'/samples/bugs/Issue494.pdf'; |
46
|
|
|
|
47
|
|
|
$config = new Config(); |
48
|
|
|
$config->setHorizontalOffset(''); |
49
|
|
|
|
50
|
|
|
$parser = $this->getParserInstance($config); |
51
|
|
|
$document = $parser->parseFile($filename); |
52
|
|
|
$text = $document->getText(); |
53
|
|
|
|
54
|
|
|
$reference = '11 ADET DERGİ İÇİN 3 KALEM HİZMET ALIMI İHALE EDİLECEKTİR '; |
55
|
|
|
$firstLine = explode("\n", $text)[0]; |
56
|
|
|
$this->assertEquals($reference, $firstLine); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|