Initial commit
This commit is contained in:
26
html2pdf-master/test/generate.ps1
Normal file
26
html2pdf-master/test/generate.ps1
Normal file
@ -0,0 +1,26 @@
|
||||
# Windows PowerShell Script
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Go to current location
|
||||
$CURRENT_FOLDER=(Get-Location)
|
||||
Set-Location (Split-Path $MyInvocation.Line -Parent)
|
||||
|
||||
# Remove the old generated PDF files
|
||||
Remove-Item *.pdf
|
||||
|
||||
# Go to the examples folder
|
||||
Set-Location ../examples
|
||||
|
||||
Get-ChildItem ./ -File | ForEach-Object {
|
||||
$PHP_SCRIPT="$_"
|
||||
$PDF_FILE="../test/$_" -replace ".php",".pdf"
|
||||
Write-Output " - $PHP_SCRIPT > $PDF_FILE"
|
||||
php $PHP_SCRIPT > $PDF_FILE
|
||||
}
|
||||
|
||||
# Go to the test folder to see the result
|
||||
Set-Location ../test
|
||||
Get-ChildItem
|
||||
|
||||
# Restore the current location
|
||||
Set-Location $CURRENT_FOLDER
|
16
html2pdf-master/test/generate.sh
Normal file
16
html2pdf-master/test/generate.sh
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$( dirname "${BASH_SOURCE[0]}" )"
|
||||
|
||||
rm -f *.pdf
|
||||
|
||||
cd ../examples
|
||||
for PHP_SCRIPT in $(ls ./*.php);
|
||||
do
|
||||
PDF_FILE=`echo "$PHP_SCRIPT" | sed 's/\.php/\.pdf/g' | sed 's/\.\//\.\.\/test\//g'`
|
||||
echo "Example $PHP_SCRIPT => $PDF_FILE"
|
||||
php $PHP_SCRIPT > $PDF_FILE
|
||||
done
|
||||
|
||||
cd ../test
|
||||
ls -l
|
Reference in New Issue
Block a user