Skip to content

Commit 1be63ad

Browse files
committed
wip - reorder
1 parent dc1eb4e commit 1be63ad

File tree

1 file changed

+11
-11
lines changed
  • resources/views/docs/desktop/1/the-basics

1 file changed

+11
-11
lines changed

resources/views/docs/desktop/1/the-basics/system.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ You can also print directly to PDF:
117117
System::printToPDF('<html>...');
118118
```
119119

120+
This returns the PDF data in a `base64_encoded` binary string. So be sure to `base64_decode` it before storing it to
121+
disk:
122+
123+
```php
124+
use Illuminate\Support\Facades\Storage;
125+
126+
$pdf = System::printToPDF('<html>...');
127+
128+
Storage::disk('desktop')->put('My Awesome File.pdf', base64_decode($pdf));
129+
```
130+
120131
### Print Settings
121132

122133
You can change the configuration before sending something to be printed, for example if you want multiple copies:
@@ -160,17 +171,6 @@ System::print('<html>...', $printer, $settings);
160171

161172
For a complete list of available print settings, refer to the [Electron webContents.print()](https://www.electronjs.org/docs/latest/api/web-contents#contentsprintoptions-callback) and [webContents.printToPDF()](https://www.electronjs.org/docs/latest/api/web-contents#contentsprinttopdfoptions) documentation.
162173

163-
This returns the PDF data in a `base64_encoded` binary string. So be sure to `base64_decode` it before storing it to
164-
disk:
165-
166-
```php
167-
use Illuminate\Support\Facades\Storage;
168-
169-
$pdf = System::printToPDF('<html>...');
170-
171-
Storage::disk('desktop')->put('My Awesome File.pdf', base64_decode($pdf));
172-
```
173-
174174
## Time Zones
175175

176176
PHP and your Laravel application will generally be configured to work with a specific time zone. This could be UTC, for

0 commit comments

Comments
 (0)