[TYPO3-dev] PDF Thumb creation

Johannes Mueller j.f.mueller at gmx.de
Wed Sep 23 11:41:08 CEST 2015


Hi Bernd,

first of please all excuse my inaccuracy. The first part of my question was
not involved in the mailing, I think.
So I just describe the whole setting once more:

I tried to get a jpeg from a pdf via the following code:

$file = $fileReference->getOriginalResource()->getOriginalFile();
$settings['additionalParameters'] = '-quality 80';
$settings['fileExtension'] = 'jpg';
$settings['width'] = $width;
$settings['backColor'] = '#ffffff';

$file->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGECROPSCALEMASK

The file got created, but I was not able to change the background color. So
around the pdf are thick black borders of about 10% of the generated image
width/height.
The solution was to change the addtionalParams:

$settings['additionalParameters'] = '-background white -alpha remove
-quality 80';

Regards, J. M.

2015-09-22 12:30 GMT+02:00 bernd wilke <t3ng at bernd-wilke.net>:

> Am 22.09.15 um 10:00 schrieb Johannes Mueller:
>
>> Hi Bernd,
>>
>> thanks for ur fast response.
>> Some test values:
>> Test 1: $settings['width'] = 240
>> 240px Width: Left -> 23px -> 9.5833333%
>> 320px Height: Top -> 29px -> 9.0625%
>>
>> Test 2: $settings['width'] = 320
>> 320px Width: Left -> 32px -> 10%
>> 453px Height: Top -> 38px -> 8.388521%
>>
>> How to adjust the background color? I looked around just a little bit, but
>> were not able to find anything.
>>
>>
> TBH I don't get what you do and how it is related to TS, but as far as I
> know should it be an image manipulation with the gifbuilder.
> and for the gifbuilder you can set background to #fff with .backColor,
> maybe you can use something like:
> $settings['backColor'] = '#ffffff';
> and any other settings for GIF_BUIDLER
>
>
> [1]
> https://docs.typo3.org/typo3cms/TyposcriptReference/6.2/Gifbuilder/ObjectNames/Index.html
>
> bernd
> --
> http://www.pi-phi.de/cheatsheet.html
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



-- 
Johannes Müller
Informatiker (B. Sc.)
mail: j.f.mueller at gmx.de
tel: +49 177 557 45 45
fax: +49 89 552 686 43



More information about the TYPO3-dev mailing list