R
R
Roman Yakimchuk2020-08-27 16:46:27
PHP
Roman Yakimchuk, 2020-08-27 16:46:27

How to convert text with source code to image in PHP?

Hello everyone

I want to convert source code from articles to images for SEO, but I can't find suitable solutions.
JavaScript source, the output must be an image in any format.

Does anyone know a PHP library?

As far as I understand, there should be a source to token converter plus drawing on the image, that's all, however, apparently, there are no such libraries.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Flat, 2020-08-28
@yakimchuk-ry

https://www.php.net/manual/en/function.highlight-s...
There is this for highlighting, then html to img, done :)

N
N, 2020-08-27
@Fernus

If you go through ready-made solutions and spend 5 minutes on Google, then...
1. HTML to PDF:
https://habr.com/ru/post/190364/
2. PDF to Image File:
https://stackoverflow.com /questions/3833125/how-to...

S
Stalker_RED, 2020-08-28
@Stalker_RED

https://team411.github.io/src2img/
_

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question