Skip to content

Commit 4b08766

Browse files
authored
Update 005-SaveDemo.au3
1 parent e3cb6c7 commit 4b08766

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

examples/005-SaveDemo.au3

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Func _Example()
2626
If @error Then Return SetError(@error, @extended, $oWebV2M)
2727

2828
; initialize browser - put it on the GUI
29-
Local $sProfileDirectory = @TempDir & "\NetWebView2Lib-UserDataFolder"
29+
Local $sProfileDirectory = @ScriptDir & "\NetWebView2Lib-UserDataFolder"
3030
_NetWebView2_Initialize($oWebV2M, $hGUI, $sProfileDirectory, 0, 0, 0, 0, True, True, True, 1.2, "0x2B2B2B")
3131

3232
; show the GUI after browser was fully initialized
@@ -40,10 +40,7 @@ Func _Example()
4040
#Region ; PDF
4141
; get Browser content as PDF Base64 encoded binary data
4242
Local $s_PDF_FileFullPath = @ScriptDir & '\5-SaveDemo_result.pdf'
43-
Local $dPDF_asBase64 = _NetWebView2_PrintToPdfStream($oWebV2M)
44-
45-
; decode Base64 encoded data do Binary
46-
Local $dBinaryDataToWrite = _NetWebView2_DecodeB64ToBinary($oWebV2M, $dPDF_asBase64)
43+
Local $dBinaryDataToWrite = _NetWebView2_PrintToPdfStream($oWebV2M, True)
4744

4845
; finally save PDF to FILE
4946
Local $hFile = FileOpen($s_PDF_FileFullPath, $FO_OVERWRITE + $FO_BINARY)
@@ -90,4 +87,3 @@ Func _Example()
9087
#EndRegion ; GUI Loop
9188

9289
EndFunc ;==>_Example
93-

0 commit comments

Comments
 (0)