TYPO3 9.5 show pdf file - typo3

My installation is TYPO3 9.5.4 plus bootstrap_package 10.0.4. I want to display a PDF file. I have included a content element type text & media to a page and connected with the PDF file. The backend shows the correct pre-view of the file. However, the frontend only shows the header line of the content element, not the PDF file (as picture). It worked under version 8.7.xx (at that time without bootstrap_package). Any hints how to solve this issue?

Maybe your installation has problems with reading PDF as image (please do the image checks). Anyway there are some PDF which can't be read because of their strange format.
As you have a backend preview image I assume the PDF is readable as image. And the preview image might exist since TYPO3 8. The FE rendering is done from current TYPO3 9 and maybe the graphic manipulation configuration is wrong.

You have to expand the file:
typo3conf/ext/bootstrap_package/Resources/Private/Partials/ContentElements/Media/Type.html
You need a new case for PDF files (Type 5):
<f:case value="5">
<f:render partial="Media/Type/Image" arguments="{file: file, data: data, settings: settings, variants: variants}" />
</f:case>
You can copy the file in your sitepackage and expand

Related

How to add an image to a pdf using Capacitor pdf-generator plugin

I’m using capacitor pdf-generator plugin to create a pdf. I managed to do so as long as the html code is limited to non image tag, code in which I inject some dynamic data by nesting variable using ${ }.
Now, my aim is to bind the src attribute of an ```img`` tag to a variable so that I can change the logo displayed in the created PDF.
Where I fail: what appears on the PDF is a white space with dashed borders (check picture attached). So I guess that the path must be correct because if not it would show the missing icon (issue I went through before I could format correctly the path).
Anyone who already had that trouble?
Finally bypassed this issue by storing the base64 data when selecting a logo and using it directly in the img tag.
<img src="data:image/png;base64,${base64data} " />
You can convert the images to base64 here https://www.base64-image.de/
then add the codes directly to your image tag

TYPO3 Backend displaying image too large

In my TYPO3 7.6.4 when I set up a text & media content element and add a picture it is displayed too large, like its shown in the screenshot
Is there a possibility to fix that? and how?
To make the image procession in TYPO3 work, make sure that
you have installed either GraphicsMagick or Imagemagick on your system
you put the correct path to the binary in [GFX][im_path]. E.g. /usr/local/bin/
you put gmor im6 into [GFX][im_version_5] depending on what you are using.
you set [GFX][image_processing] to 1.
You can change these values in the install tool under "all configuration" in the GFX section.
You should also clear your processed images in the install tool ("Clean up" section) to make sure they are generated with an updated configuration:
Your image processing tests should look like this:
Maybe your PHP is configured to not execute binarys on the server, so ImageMagick can't be launched.
Check "System evironment" in the install tool for some errors or check if the php setting disable_functions containts exec.
if IM/GM is working well (install_tools test are ok) and the thumbnails in file list module are computed correct its the preview in the content elements.
Have a look at the preview definition of your content elements: is the HTML and CSS correct to show the image inside the preview area of that contentelement?

Typo3 GraphicMagick Thumbs transparent

Im working on a website using typo3 and the image handler being used is GraphicMagick. At an certain page im displaying an Latest view news item.
This news item contains an media pdf file.
So when I visit that page I will see an Thumb of that pdf since that is being created by GraphicMagick and stored in my typo3temp folder.
Now the real question is.. that this gif file, is like 10-15% transparent at the top.
I have no idea how this comes.. the settings in the installation tool look similar to the onces I use on a different website.
Did anybody see this before and knows how I might resolve this ?
I'm using the following versions:
Typo3: 6.2.11
imagehandler: Graphics Magick
[GFX][thumbnails_png] = 1
Solved it for me, gifs gave me a problem

Rendering Images inside PDF, images not being rendered in PDF Viewer 0.1.8

Please check updates as they have additional informations... Apparently located the problem in a specific pdf client but cannot close the issue with an open bounty...
I am generating a pdf using grails rendering plugin. The PDF has a couple of images inside and "some" of them are not being outputted!
I am rendering the images inline via data uris as required by the plugin. That means that all my images are something like:
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQECWAJYAAD...">
If I render them in a normal html view, I can see the images just fine!
If I render the template to a JPG/PNG with the same plugin, again the images render all fine.
If I render to PDF the images which are being retrieved by an octed-stream are broken!
Something like:
Looks like the image started to render and then something happened...
It is happening on the big-sized images, but also on the thumbnail version of same image.
Any one has some hints as why this might occur?
UPDATE
The file which does not show up is a file with mime application/octet-stream
So apparently I can retrieve the bytes from the file, but when they transmitted for PDF Rendering, the image does not appear...
Yet another update
The issue seems to be related with the PDF Viewer. Was using a Linux based PDF Viewer (PDF Viewer 0.1.8) and specific images are broken. In all other PDF Viewers I could test everything works fine.
Cannot close the issue as there is a bounty open :( Sorry that the bounty and question seems meaningless now, but you never know, someone might have an idea how to solve this even for PDF Viewer 0.1.8.
<img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQECWAJYAAD...">
works fine for me. Note the missing "e".
You can use rendering tag:
<rendering:inlineJpeg bytes="${your-image}" />
Make sure you decodeBase64() your image.

Inserting and Displaying images within the TinyMCE content editor in PHP site

I am currently using tinyMCE to edit content within my site and I am looking for a way display an image within the tinyMCE once it has been uploaded to the site.
Note: I am not looking for a means to upload an image directly into tinyMCE. I am looking for the tinyMCE command which would allow me to display an image within the content in the editor after I have uploaded it.
Thanks
You could insert a regular img-tag inside tinymce using a custom plugin or using the setup parameter in your tinymce init. The src should refer to the html location of the image to be uploaded. As soon as the image is available the image will become visible on next reload of the editors content. If you need further assistance feel free to ask.
After successfull uploaded you have the source of the image (img_src). Now you need to add it to the editor like this
tinymce.activeEditor.insertContent('<img alt="photo" src="' + img_src + '"/>');