You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been stuck on this project for several months. I'm trying to translate my visitors' PDFs directly into the Google Translate server and I'd like you to help me do it with your library please. Here's the link: Google Translate https://translate.google.com/?hl=en&sl=en&tl=fr&op=docs
Here is the beginning of my code:
<?php
require 'vendor/autoload.php';
// Path to your PDF file and download destination
$pdfPath = 'documents/con.pdf';
$downloadPath = 'save/translated.pdf';
use HeadlessChromium\BrowserFactory;
use HeadlessChromium\Page;
$browserFactory = new BrowserFactory();
$browser = $browserFactory->createBrowser();
try {
$page = $browser->createPage();
$page->navigate('https://translate.google.com/?hl=en&sl=en&tl=fr&op=docs')->waitForNavigation('networkIdle', 10000);
$elem = $page->dom()->querySelector('.ZdLswd')->click();
// screenshot - Say "Cheese"! 😄
$page->screenshot()->saveToFile('save/bar.png');
// pdf
$page->pdf(['printBackground' => true])->saveToFile('save/bar.pdf');
} finally {
$browser->close();
}
I'm extremely stuck and I don't know what to do... PLEASE! Any help will be appreciated.
The text was updated successfully, but these errors were encountered:
And what is the problem you are having, specifically?
I'll explain it more succinctly. My main goal is to use your library to submit my PDF directly to the Google Translate server https://translate.google.com/?hl=en&sl=en&tl=fr&op=docs for translation. But I can't do that with your library. Can you help me do this or give me a block of code that I can use to do it please?
Hi there!
I've been stuck on this project for several months. I'm trying to translate my visitors' PDFs directly into the Google Translate server and I'd like you to help me do it with your library please. Here's the link: Google Translate https://translate.google.com/?hl=en&sl=en&tl=fr&op=docs
Here is the beginning of my code:
I'm extremely stuck and I don't know what to do... PLEASE! Any help will be appreciated.
The text was updated successfully, but these errors were encountered: