code
New Member
Posts: 30
|
Post by code on Sept 5, 2022 23:03:19 GMT -5
Hi,
I had the idea to take a picture from the webcam and then insert into a pdf file... It is unfinshed code ... the webcam starts ... But till now no luck to insert a image... you?
Here the code till so far:(free to use/modify/spread)
nomainwin
WindowWidth=800
WindowHeight=600
button #scr, "Snapshot... ", [snap], UL, 550, 100
button #scr, "Start cam... ", [cam], UL, 550, 10
button #scr, "Make ugly pdf and run... ", [b1], UL, 550, 500
button #scr, "Draw lines... ", [b2], UL, 55, 500
graphicbox #scr.gr, 250, 10, 800, 450
texteditor #scr.te, 10, 10, 600, 450
open "Ugly pdf..." for graphics as #scr
print #scr.te, "Type here some text..."
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, "...some text..."
print #scr, "fill darkred"
print #scr, "flush"
fl=0
ln=0
dim x1(900)
dim y1(900)
dim x2(900)
dim y2(900)
xp=30
yp=120
res=mkdir("C:\ugly-pdf\")
cap=0
wait
[snap]
ZWTEST=HEXDEC("&H400")
tg1=ZWTEST+61
tg2=ZWTEST+25
calldll #user32, "SendMessageA", cap as long,tg1 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,tg2 as long,0 as long,"c:\ugly-pdf\webcam-image.bmp" as PTR,r as long
loadbmp "landscape", "c:\ugly-pdf\webcam-image.bmp"
print #scr.gr, "background landscape";
print #scr.gr, "backgroundxy ";10;" ";10
print #scr.gr, "drawsprites"
open "c:\ugly-pdf\makejpg.ps1" for output as #tp
print #tp,"Write-Host "+chr$(34)+" "+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Basic..."+chr$(34)
print #tp,"$PSVersionTable"
print #tp," "
print #tp," "
print #tp,"[void] [Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Windows.Forms"+chr$(34)+")"
print #tp,"$DestDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"$SrcDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"PushD $SrcDir"
print #tp,"Get-ChildItem *.bmp | "
print #tp," ForEach-Object{"
print #tp," $NewFileName = ( Join-Path $DestDir ($_.BaseName.SubString(0)+'.jpg' ))"
print #tp," $Picture = new-object System.Drawing.Bitmap($_.FullName)"
print #tp," $Picture.Save($NewFileName ,'JPEG') "
print #tp," }"
print #tp,"PopD"
close #tp
RUN"Powershell.exe -executionpolicy bypass -File C:\ugly-pdf\makejpg.ps1",hide
wait
[cam]
hw = hwnd(#scr)
reeks = _WS_VISIBLE OR _WS_CHILD
open "avicap32.dll" for DLL as #nd
calldll #nd , "capCreateCaptureWindowA", 0 as long, reeks as ptr,10 as long, 10 as long,400 as long, 300 as long,hw as long,0 as long,cap as long
calldll #user32, "SendMessageA", cap as long,1034 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1077 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1076 as long,20 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1074 as long,1 as long,0 as long,r as long
wait
[d2]
print #scr2, "fill white"
print #scr2, "flush"
for dbl = 0 to fl step 1
print #scr2, "color blue"
print #scr2, "line ";x1(dbl);" ";y1(dbl);" ";x2(dbl);" ";y2(dbl);
next dbl
if status=1 then
print #scr2, "color blue"
print #scr2, "line ";x1(ln);" ";y1(ln);" ";MouseX;" ";MouseY;
end if
wait
[d]
status=status+1
if status=2 then
fl=fl+1
x2(fl)=MouseX
y2(fl)=MouseY
status=0
end if
if status=1 then
ln=ln+1
x1(ln)=MouseX
y1(ln)=MouseY
end if
wait
[b2]
open "Draw blue lines with mousedown..." for graphics_nsb as #scr2
print #scr2, "fill white"
print #scr2, "flush"
print #scr2, "when leftButtonDown [d]"
print #scr2, "down ; size 1"
print #scr2, "when mouseMove [d2]"
wait
[b1]
print #scr.te, "!lines cl" ;
open "C:\ugly-pdf\test.pdf" for output as #tf
print #tf,"%PDF-1.1"
print #tf,"%????"
print #tf,"1 0 obj"
print #tf,"<<"
print #tf,"/Kids [2 0 R]"
print #tf,"/Type /Pages"
print #tf,"/Count 1"
print #tf,">>"
print #tf,"endobj"
print #tf,"2 0 obj"
print #tf,"<<"
print #tf,"/Rotate 0"
print #tf,"/Parent 1 0 R"
print #tf,"/MediaBox [0 0 792 ";(cl*20)+40;"]"
print #tf,"/Resources 3 0 R"
print #tf,"/Type /Page"
print #tf,"/Contents [4 0 R]"
print #tf,">>"
print #tf,"endobj"
print #tf,"3 0 obj "
print #tf,"<<"
print #tf,"/Font"
print #tf,"<<"
print #tf,"/F0"
print #tf,"<<"
print #tf,"/BaseFont /Arial"
print #tf,"/Subtype /Type1"
print #tf,"/Type /Font"
print #tf,">>"
print #tf,">>"
print #tf,">>"
print #tf,"endobj "
print #tf,"4 0 obj "
print #tf,"<<"
print #tf,"/Length 121"
print #tf,"/Filter/DCTDecode"
print #tf,"/Type/XObject/"
print #tf,"Length 33555/"
print #tf,"Height 413/"
print #tf,"BitsPerComponent 8/"
print #tf,"Subtype/Image/'"
print #tf,"Width 640"
print #tf,"stream"
''here image code?
''open "C:\ugly-pdf\web.jpg" for input as #fIn
'' content$ =input$( #fIn, lof( #fIn))
''close #fIn
''print #tf,content$
print #tf,"endstream"
print #tf,">>"
print #tf,"stream"
print #tf,"0.5 g"
print #tf,"0 0 0 rg"
print #tf,"BT"
print #tf,"/F0 20 Tf"
print #tf,"1 0 0 1 60 ";(cl*20)+40;" Tm"
print #tf,"20 TL"
print #tf,"() Tj T*"
for i = 0 to cl step 1
print #scr.te, "!line ";i;" linete$" ;
print #tf,"2 Tr"
print #tf,"(";linete$;") Tj T*"
next i
print #tf,"ET"
for dl = 1 to fl step 1
print #tf,"0 0 1 rg"
print #tf," ";x1(dl)+xp;" ";(cl*20)-y1(dl)+yp;" m"
print #tf," ";x2(dl)+xp;" ";(cl*20)-y2(dl)+yp;" l"
print #tf," f"
next dl
print #tf,"endstream"
print #tf,"endobj"
print #tf,"5 0 obj"
print #tf,"<<"
print #tf,"/Pages 1 0 R"
print #tf,"/Type /Catalog"
print #tf,">>"
print #tf,"endobj xref"
print #tf,"0 6"
print #tf,"0000000000 65535 f"
print #tf,"0000000015 00000 n"
print #tf,"0000000074 00000 n"
print #tf,"0000000192 00000 n"
print #tf,"0000000291 00000 n"
print #tf,"0000000466 00000 n"
print #tf,"trailer"
print #tf,""
print #tf,"<<"
print #tf,"/Root 5 0 R"
print #tf,"/Size 6"
print #tf,">>"
print #tf,"startxref"
print #tf,"516"
print #tf,"%%EOF"
close #tf
b$ = "C:\ugly-pdf\test.pdf"
RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
Regards, code
|
|
|
Post by Rod on Sept 7, 2022 2:40:10 GMT -5
My camera turns on and has a green led confirming but the camera window just shows black and the image that is saved cannot be opened and is flagged as corrupted.
|
|
code
New Member
Posts: 30
|
Post by code on Sept 7, 2022 3:52:22 GMT -5
Hi Rod, Thats true... i tested it on a another laptop and it didn't work... so the code isn't 'reliable' But wanted to share... (you have to be lucky...) Thanks for testing... Regards, code
|
|
|
Post by Rod on Sept 7, 2022 12:19:59 GMT -5
Not had time to explore the code. It could be something simple holding it back. It would be really good to have a routine that gave Liberty access to the camera.
Hope some gurus will get involved.
|
|
code
New Member
Posts: 30
|
Post by code on Sept 7, 2022 17:15:19 GMT -5
Put this line: calldll #user32, "SendMessageA", cap as long,1065 as long,0 as long,0 as long,r as long
after this 4 lines in the code (you get more option(choose yuy...?))
calldll #user32, "SendMessageA", cap as long,1034 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1077 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1076 as long,20 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1074 as long,1 as long,0 as long,r as long
|
|
|
Post by Rod on Sept 8, 2022 7:25:06 GMT -5
That works for me, as soon as I chose YUY I got an image, and it was successfully saved as a loadable .bmp I don't need the pdf part I really just want to automate the opening of the camera and then to be able to take timed snapshots. I will then analyse the .bmp.
John posted such code a while back but I could never get it to open my camera.
|
|
code
New Member
Posts: 30
|
Post by code on Sept 8, 2022 23:59:43 GMT -5
Hi,
I decided to post again the code i have till so far. Intresting in the code is that the image C:\ugly-pdf\webcam-image.bmp can be converted to a jpg (this is necessary when we want to build a .pdf with image) This is done by a powershell script(C:\ugly-pdf\makejpg.ps1) What we need is code to insert the jpg in the .pdf ... (i am not good in pdf format),so you can/must expirement with that I doubt if I soon take a look at it...
Here the code:(free to use/modify/spread)
nomainwin
WindowWidth=800
WindowHeight=600
button #scr, "Snapshot... ", [snap], UL, 550, 100
button #scr, "Start cam... ", [cam], UL, 550, 10
button #scr, "Make ugly pdf and run... ", [b1], UL, 550, 500
button #scr, "Draw lines... ", [b2], UL, 55, 500
graphicbox #scr.gr, 250, 10, 800, 450
texteditor #scr.te, 10, 10, 600, 450
open "Ugly pdf..." for graphics as #scr
print #scr.te, "Type here some text..."
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, "...some text..."
print #scr, "fill darkred"
print #scr, "flush"
fl=0
ln=0
dim x1(900)
dim y1(900)
dim x2(900)
dim y2(900)
xp=30
yp=120
res=mkdir("C:\ugly-pdf\")
cap=0
wait
[snap]
ZWTEST=HEXDEC("&H400")
tg1=ZWTEST+61
tg2=ZWTEST+25
calldll #user32, "SendMessageA", cap as long,tg1 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,tg2 as long,0 as long,"c:\ugly-pdf\webcam-image.bmp" as PTR,r as long
loadbmp "landscape", "c:\ugly-pdf\webcam-image.bmp"
print #scr.gr, "background landscape";
print #scr.gr, "backgroundxy ";10;" ";10
print #scr.gr, "drawsprites"
open "c:\ugly-pdf\makejpg.ps1" for output as #tp
print #tp,"[void] [System.Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Drawing"+chr$(34)+")" print #tp,"[void] [System.Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Windows.Forms"+chr$(34)+")"
print #tp," "
print #tp,"param([switch]$Elevated)"
print #tp,"function Test-Admin {" print #tp," $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())" print #tp," $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)" print #tp,"}"
print #tp,"if ((Test-Admin) -eq $false) {" print #tp," if ($elevated) {" print #tp," # tried to elevate, did not work, aborting" print #tp," } else {" print #tp," Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "+chr$(34)+"{0}"+chr$(34)+" -elevated' -f ($myinvocation.MyCommand.Definition))" print #tp," }" print #tp," exit" print #tp,"}"
print #tp,"Write-Host "+chr$(34)+" "+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Basic..."+chr$(34)
print #tp,"$PSVersionTable"
print #tp,"[void] [Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Windows.Forms"+chr$(34)+")"
print #tp,"$DestDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"$SrcDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"PushD $SrcDir"
print #tp,"Get-ChildItem *.bmp | "
print #tp," ForEach-Object{"
print #tp," $NewFileName = ( Join-Path $DestDir ($_.BaseName.SubString(0)+'.jpg' ))"
print #tp," $Picture = new-object System.Drawing.Bitmap($_.FullName)"
print #tp," $Picture.Save($NewFileName ,'JPEG') "
print #tp," }"
print #tp,"PopD"
print #tp,"Write-Host "+chr$(34)+"This is for creating a .jpg image..."+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Look for webcam-image.jpg in C:\ugly-pdf\ "+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Greetings from code !"+chr$(34)
close #tp
RUN"Powershell.exe -File C:\ugly-pdf\makejpg.ps1" ,hide
wait
[cam]
hw = hwnd(#scr)
reeks = _WS_VISIBLE OR _WS_CHILD
open "avicap32.dll" for DLL as #nd
calldll #nd , "capCreateCaptureWindowA", 0 as long, reeks as ptr,10 as long, 10 as long,400 as long, 300 as long,hw as long,0 as long,cap as long
calldll #user32, "SendMessageA", cap as long,1034 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1077 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1076 as long,20 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1074 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1065 as long,0 as long,0 as long,r as long
wait
[d2]
print #scr2, "fill white"
print #scr2, "flush"
for dbl = 0 to fl step 1
print #scr2, "color blue"
print #scr2, "line ";x1(dbl);" ";y1(dbl);" ";x2(dbl);" ";y2(dbl);
next dbl
if status=1 then
print #scr2, "color blue"
print #scr2, "line ";x1(ln);" ";y1(ln);" ";MouseX;" ";MouseY;
end if
wait
[d]
status=status+1
if status=2 then
fl=fl+1
x2(fl)=MouseX
y2(fl)=MouseY
status=0
end if
if status=1 then
ln=ln+1
x1(ln)=MouseX
y1(ln)=MouseY
end if
wait
[b2]
open "Draw blue lines with mousedown..." for graphics_nsb as #scr2
print #scr2, "fill white"
print #scr2, "flush"
print #scr2, "when leftButtonDown [d]"
print #scr2, "down ; size 1"
print #scr2, "when mouseMove [d2]"
wait
[b1]
print #scr.te, "!lines cl" ;
open "C:\ugly-pdf\test.pdf" for output as #tf
print #tf,"%PDF-1.1"
print #tf,"%????"
print #tf,"1 0 obj"
print #tf,"<<"
print #tf,"/Kids [2 0 R]"
print #tf,"/Type /Pages"
print #tf,"/Count 1"
print #tf,">>"
print #tf,"endobj"
print #tf,"2 0 obj"
print #tf,"<<"
print #tf,"/Rotate 0"
print #tf,"/Parent 1 0 R"
print #tf,"/MediaBox [0 0 792 ";(cl*20)+40;"]"
print #tf,"/Resources 3 0 R"
print #tf,"/Type /Page" print #tf,"/XObject/I1 32 0 R " print #tf,"/Contents [4 0 R]"
print #tf,">>"
print #tf,"endobj"
print #tf,"32 0 obj " print #tf,"<</Name /I1" print #tf,"/Type /XObject" print #tf,"/Subtype" print #tf,"/Image" print #tf,"/Width 300" print #tf,"/Height 150" print #tf,"/Length 80000" print #tf,"/Filter" print #tf,"/DCTDecode" print #tf,"/ColorSpace" print #tf,"/DeviceRGB" print #tf,"/BitsPerComponent 8>>" print #tf,"stream"
open "C:\ugly-pdf\webcam-image.jpg" for input as #fIn content$ =input$( #fIn, lof( #fIn)) close #fIn
print #tf,content$
print #tf,"endstream"
print #tf,"endobj"
print #tf,"3 0 obj "
print #tf,"<<"
print #tf,"/Font"
print #tf,"<<"
print #tf,"/F0"
print #tf,"<<"
print #tf,"/BaseFont /Arial"
print #tf,"/Subtype /Type1"
print #tf,"/Type /Font"
print #tf,">>"
print #tf,">>"
print #tf,">>"
print #tf,"endobj "
print #tf,"4 0 obj "
print #tf,"<<"
print #tf,"/Length 121"
print #tf,"/Filter/DCTDecode"
print #tf,"/Type/XObject/"
print #tf,"Length 33555/"
print #tf,"Height 413/"
print #tf,"BitsPerComponent 8/"
print #tf,"Subtype/Image/'"
print #tf,"Width 640"
print #tf,"stream"
print #tf,"endstream"
print #tf,">>"
print #tf,"stream"
print #tf,"0.5 g"
print #tf,"0 0 0 rg"
print #tf,"BT"
print #tf,"/F0 20 Tf"
print #tf,"1 0 0 1 60 ";(cl*20)+40;" Tm"
print #tf,"20 TL"
print #tf,"() Tj T*"
for i = 0 to cl step 1
print #scr.te, "!line ";i;" linete$" ;
print #tf,"2 Tr"
print #tf,"(";linete$;") Tj T*"
next i
print #tf,"ET"
for dl = 1 to fl step 1
print #tf,"0 0 1 rg"
print #tf," ";x1(dl)+xp;" ";(cl*20)-y1(dl)+yp;" m"
print #tf," ";x2(dl)+xp;" ";(cl*20)-y2(dl)+yp;" l"
print #tf," f"
next dl
print #tf,"endstream"
print #tf,"endobj"
print #tf,"5 0 obj"
print #tf,"<<"
print #tf,"/Pages 1 0 R"
print #tf,"/Type /Catalog"
print #tf,">>"
print #tf,"endobj xref"
print #tf,"0 6"
print #tf,"0000000000 65535 f"
print #tf,"0000000015 00000 n"
print #tf,"0000000074 00000 n"
print #tf,"0000000192 00000 n"
print #tf,"0000000291 00000 n"
print #tf,"0000000466 00000 n"
print #tf,"trailer"
print #tf,""
print #tf,"<<"
print #tf,"/Root 5 0 R"
print #tf,"/Size 6"
print #tf,">>"
print #tf,"startxref"
print #tf,"516"
print #tf,"%%EOF"
close #tf
b$ = "C:\ugly-pdf\test.pdf"
RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
|
|
code
New Member
Posts: 30
|
Post by code on Sept 10, 2022 22:08:18 GMT -5
'finished'
Here the code:(free to use/modify/spread)
nomainwin
WindowWidth=800
WindowHeight=600
button #scr, "Snapshot... ", [snap], UL, 550, 100
button #scr, "Start cam... ", [cam], UL, 550, 10
button #scr, "Make ugly pdf and run... ", [b1], UL, 350, 500
button #scr, "Draw lines... ", [b2], UL, 55, 500
button #scr, "Image pdf...", [image], UL, 600, 500
graphicbox #scr.gr, 250, 10, 800, 450
texteditor #scr.te, 10, 10, 600, 450
open "Ugly pdf..." for graphics as #scr
print #scr.te, "Type here some text..."
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, "...some text..."
print #scr, "fill darkred"
print #scr, "flush"
fl=0
ln=0
dim x1(900)
dim y1(900)
dim x2(900)
dim y2(900)
xp=30
yp=120
res=mkdir("C:\ugly-pdf\")
cap=0
wait [image]
open "c:\ugly-pdf\image.pdf" for output as #ti
print #ti,"%PDF-1.5" print #ti,"%??" print #ti,""
print #ti,"8 0 obj" print #ti,"<<" print #ti,"/Type /Page/Parent 2 0 R" print #ti,"/Rotate 0" print #ti,"/MediaBox [0 0 600 900]/CropBox [0 0 595 842]" print #ti,"/Resources<</ProcSet[/PDF/Text]" print #ti,"/Font<</T1 3 0 R/T2 4 0 R/T3 5 0 R/T4 6 0 R>>" print #ti,"/XObject <</I1 10 0 R >>>>" print #ti,"/Contents 9 0 R" print #ti,">>" print #ti,"endobj" print #ti,""
print #ti,"9 0 obj<</Length 989" print #ti,">>stream" print #ti,"q" print #ti,"144 0 0 100 10 700 cm" print #ti,"1 0 0 1 0 0 cm" print #ti,"/I1 Do" print #ti,"Q" print #ti,"BT/T3 12 Tf" print #ti,"100 650 Td" print #ti,"(Greetings from code!) Tj" print #ti,"ET" print #ti,"endstream" print #ti,"endobj" print #ti,""
print #ti,"1 0 obj<</Type /Catalog/Lang(EN-US)/Pages 2 0 R>>" print #ti,"endobj" print #ti,""
print #ti,"2 0 obj<</Count 1/Kids [ 8 0 R ]>>" print #ti,"endobj" print #ti,""
print #ti,"3 0 obj<</Type/Font/Name /T1/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj" print #ti,"4 0 obj<</Type/Font/Name /T2/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj" print #ti,"5 0 obj<</Type/Font/Name /T3/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj" print #ti,"6 0 obj<</Type/Font/Name /T4/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj"
print #ti,"10 0 obj" print #ti,"<</Name /I1" print #ti,"/Type /XObject" print #ti,"/Subtype /Image" print #ti,"/Width 600" print #ti,"/Height 600" print #ti,"/Length 29779" print #ti,"/Filter /DCTDecode" print #ti,"/ColorSpace /DeviceRGB" print #ti,"/BitsPerComponent 8" print #ti,">> stream" print #ti,""
open "C:\ugly-pdf\webcam-image.jpg" for input as #fIn content$ =input$( #fIn, lof( #fIn)) close #fIn
print #ti,content$
print #ti,""
print #ti,"endstream" print #ti,"endobj"
print #ti,"xref" print #ti,"0 11"
print #ti,"trailer" print #ti,"<</Size 11" print #ti,"/Root 1 0 R" print #ti,"/Info 7 0 R" print #ti,"/ID[<5181383ede94727bcb32ac27ded71c68>" print #ti,"<5181383ede94727bcb32ac27ded71c68>]" print #ti,">>"
print #ti,"startxref" print #ti,"31959" print #ti,"%%EOF"
print #ti," "
close #ti
b$ = "C:\ugly-pdf\image.pdf"
RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
[snap]
ZWTEST=HEXDEC("&H400")
tg1=ZWTEST+61
tg2=ZWTEST+25
calldll #user32, "SendMessageA", cap as long,tg1 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,tg2 as long,0 as long,"c:\ugly-pdf\webcam-image.bmp" as PTR,r as long
loadbmp "landscape", "c:\ugly-pdf\webcam-image.bmp"
print #scr.gr, "background landscape";
print #scr.gr, "backgroundxy ";10;" ";10
print #scr.gr, "drawsprites"
open "c:\ugly-pdf\makejpg.ps1" for output as #tp
print #tp,"[void] [System.Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Drawing"+chr$(34)+")" print #tp,"[void] [System.Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Windows.Forms"+chr$(34)+")"
print #tp," "
print #tp,"param([switch]$Elevated)"
print #tp,"function Test-Admin {" print #tp," $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())" print #tp," $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)" print #tp,"}"
print #tp,"if ((Test-Admin) -eq $false) {" print #tp," if ($elevated) {" print #tp," # tried to elevate, did not work, aborting" print #tp," } else {" print #tp," Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "+chr$(34)+"{0}"+chr$(34)+" -elevated' -f ($myinvocation.MyCommand.Definition))" print #tp," }" print #tp," exit" print #tp,"}"
print #tp,"Write-Host "+chr$(34)+" "+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Basic..."+chr$(34)
print #tp,"$PSVersionTable"
print #tp,"[void] [Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Windows.Forms"+chr$(34)+")"
print #tp,"$DestDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"$SrcDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"PushD $SrcDir"
print #tp,"Get-ChildItem *.bmp | "
print #tp," ForEach-Object{"
print #tp," $NewFileName = ( Join-Path $DestDir ($_.BaseName.SubString(0)+'.jpg' ))"
print #tp," $Picture = new-object System.Drawing.Bitmap($_.FullName)"
print #tp," $Picture.Save($NewFileName ,'JPEG') "
print #tp," }"
print #tp,"PopD"
print #tp,"Write-Host "+chr$(34)+"This is for creating a .jpg image..."+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Look for webcam-image.jpg in C:\ugly-pdf\ "+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Greetings from code !"+chr$(34)
close #tp
RUN"Powershell.exe -File C:\ugly-pdf\makejpg.ps1" ,hide
wait
[cam]
hw = hwnd(#scr)
reeks = _WS_VISIBLE OR _WS_CHILD
open "avicap32.dll" for DLL as #nd
calldll #nd , "capCreateCaptureWindowA", 0 as long, reeks as ptr,10 as long, 10 as long,400 as long, 300 as long,hw as long,0 as long,cap as long
calldll #user32, "SendMessageA", cap as long,1034 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1077 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1076 as long,20 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1074 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1065 as long,0 as long,0 as long,r as long
wait
[d2]
print #scr2, "fill white"
print #scr2, "flush"
for dbl = 0 to fl step 1
print #scr2, "color blue"
print #scr2, "line ";x1(dbl);" ";y1(dbl);" ";x2(dbl);" ";y2(dbl);
next dbl
if status=1 then
print #scr2, "color blue"
print #scr2, "line ";x1(ln);" ";y1(ln);" ";MouseX;" ";MouseY;
end if
wait
[d]
status=status+1
if status=2 then
fl=fl+1
x2(fl)=MouseX
y2(fl)=MouseY
status=0
end if
if status=1 then
ln=ln+1
x1(ln)=MouseX
y1(ln)=MouseY
end if
wait
[b2]
open "Draw blue lines with mousedown..." for graphics_nsb as #scr2
print #scr2, "fill white"
print #scr2, "flush"
print #scr2, "when leftButtonDown [d]"
print #scr2, "down ; size 1"
print #scr2, "when mouseMove [d2]"
wait
[b1]
print #scr.te, "!lines cl" ;
open "C:\ugly-pdf\test.pdf" for output as #tf
print #tf,"%PDF-1.1"
print #tf,"%????"
print #tf,"1 0 obj"
print #tf,"<<"
print #tf,"/Kids [2 0 R]"
print #tf,"/Type /Pages"
print #tf,"/Count 1"
print #tf,">>"
print #tf,"endobj"
print #tf,"2 0 obj"
print #tf,"<<"
print #tf,"/Rotate 0"
print #tf,"/Parent 1 0 R"
print #tf,"/MediaBox [0 0 792 ";(cl*20)+40;"]"
print #tf,"/Resources 3 0 R"
print #tf,"/Type /Page" print #tf,"/XObject/I1 32 0 R " print #tf,"/Contents [4 0 R]"
print #tf,">>"
print #tf,"endobj"
print #tf,"32 0 obj " print #tf,"<</Name /I1" print #tf,"/Type /XObject" print #tf,"/Subtype" print #tf,"/Image" print #tf,"/Width 300" print #tf,"/Height 150" print #tf,"/Length 80000" print #tf,"/Filter" print #tf,"/DCTDecode" print #tf,"/ColorSpace" print #tf,"/DeviceRGB" print #tf,"/BitsPerComponent 8>>" print #tf,"stream"
open "C:\ugly-pdf\webcam-image.jpg" for input as #fIn content$ =input$( #fIn, lof( #fIn)) close #fIn
print #tf,content$
print #tf,"endstream"
print #tf,"endobj"
print #tf,"3 0 obj "
print #tf,"<<"
print #tf,"/Font"
print #tf,"<<"
print #tf,"/F0"
print #tf,"<<"
print #tf,"/BaseFont /Arial"
print #tf,"/Subtype /Type1"
print #tf,"/Type /Font"
print #tf,">>"
print #tf,">>"
print #tf,">>"
print #tf,"endobj "
print #tf,"4 0 obj "
print #tf,"<<"
print #tf,"/Length 121"
print #tf,"/Filter/DCTDecode"
print #tf,"/Type/XObject/"
print #tf,"Length 33555/"
print #tf,"Height 413/"
print #tf,"BitsPerComponent 8/"
print #tf,"Subtype/Image/'"
print #tf,"Width 640"
print #tf,"stream"
print #tf,"endstream"
print #tf,">>"
print #tf,"stream"
print #tf,"0.5 g"
print #tf,"0 0 0 rg"
print #tf,"BT"
print #tf,"/F0 20 Tf"
print #tf,"1 0 0 1 60 ";(cl*20)+40;" Tm"
print #tf,"20 TL"
print #tf,"() Tj T*"
for i = 0 to cl step 1
print #scr.te, "!line ";i;" linete$" ;
print #tf,"2 Tr"
print #tf,"(";linete$;") Tj T*"
next i
print #tf,"ET"
for dl = 1 to fl step 1
print #tf,"0 0 1 rg"
print #tf," ";x1(dl)+xp;" ";(cl*20)-y1(dl)+yp;" m"
print #tf," ";x2(dl)+xp;" ";(cl*20)-y2(dl)+yp;" l"
print #tf," f"
next dl
print #tf,"endstream"
print #tf,"endobj"
print #tf,"5 0 obj"
print #tf,"<<"
print #tf,"/Pages 1 0 R"
print #tf,"/Type /Catalog"
print #tf,">>"
print #tf,"endobj xref"
print #tf,"0 6"
print #tf,"0000000000 65535 f"
print #tf,"0000000015 00000 n"
print #tf,"0000000074 00000 n"
print #tf,"0000000192 00000 n"
print #tf,"0000000291 00000 n"
print #tf,"0000000466 00000 n"
print #tf,"trailer"
print #tf,""
print #tf,"<<"
print #tf,"/Root 5 0 R"
print #tf,"/Size 6"
print #tf,">>"
print #tf,"startxref"
print #tf,"516"
print #tf,"%%EOF"
close #tf
b$ = "C:\ugly-pdf\test.pdf"
RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
|
|
code
New Member
Posts: 30
|
Post by code on Sept 11, 2022 5:31:17 GMT -5
Hi, I did again a test on another laptop The powershell command didn't work, wich we need to convert the C:\ugly-pdf\webcam-image.bmp to .jpg (C:\ugly-pdf\webcam-image.jpg) So powershell.exe must be installed to get it totally working. Poor me ! ___________ Regards, code
|
|
|
Post by Rod on Sept 11, 2022 6:02:27 GMT -5
Yes, I got the pdf but never any graphic, though the camera part works. I also note that my camera now works reliably with John's older code. It seems setting to YUY is important. My system has also remembered that setting. So progress for me.
|
|
code
New Member
Posts: 30
|
Post by code on Sept 11, 2022 6:49:38 GMT -5
Hi, Yes , you could write a .jpg image in the 'C:\ugly-pdf\webcam-image.jpg' folder to test it (with paint program). If you install powershell... it will make you nervous haaha But thx for your reply (preciate it) Regards, code
|
|
code
New Member
Posts: 30
|
Post by code on Sept 11, 2022 10:42:41 GMT -5
I guess i was wrong again(powershell not installed) What about this one: (free to use/modify/spread)
nomainwin
WindowWidth=800
WindowHeight=600
button #scr, "Snapshot... ", [snap], UL, 550, 100
button #scr, "Start cam... ", [cam], UL, 550, 10
button #scr, "Make ugly pdf and run... ", [b1], UL, 350, 500
button #scr, "Draw lines... ", [b2], UL, 55, 500
button #scr, "Image pdf...", [image], UL, 600, 500
graphicbox #scr.gr, 250, 10, 800, 450
texteditor #scr.te, 10, 10, 600, 450
open "Ugly pdf..." for graphics as #scr
print #scr.te, "Type here some text..."
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, ""
print #scr.te, "...some text..."
print #scr, "fill darkred"
print #scr, "flush"
fl=0
ln=0
dim x1(900)
dim y1(900)
dim x2(900)
dim y2(900)
xp=30
yp=120
res=mkdir("C:\ugly-pdf\")
cap=0
wait [image]
open "c:\ugly-pdf\image.pdf" for output as #ti
print #ti,"%PDF-1.5" print #ti,"%??" print #ti,""
print #ti,"8 0 obj" print #ti,"<<" print #ti,"/Type /Page/Parent 2 0 R" print #ti,"/Rotate 0" print #ti,"/MediaBox [0 0 600 900]/CropBox [0 0 595 842]" print #ti,"/Resources<</ProcSet[/PDF/Text]" print #ti,"/Font<</T1 3 0 R/T2 4 0 R/T3 5 0 R/T4 6 0 R>>" print #ti,"/XObject <</I1 10 0 R >>>>" print #ti,"/Contents 9 0 R" print #ti,">>" print #ti,"endobj" print #ti,""
print #ti,"9 0 obj<</Length 989" print #ti,">>stream" print #ti,"q" print #ti,"144 0 0 100 10 700 cm" print #ti,"1 0 0 1 0 0 cm" print #ti,"/I1 Do" print #ti,"Q" print #ti,"BT/T3 12 Tf" print #ti,"100 650 Td" print #ti,"(Greetings from code!) Tj" print #ti,"ET" print #ti,"endstream" print #ti,"endobj" print #ti,""
print #ti,"1 0 obj<</Type /Catalog/Lang(EN-US)/Pages 2 0 R>>" print #ti,"endobj" print #ti,""
print #ti,"2 0 obj<</Count 1/Kids [ 8 0 R ]>>" print #ti,"endobj" print #ti,""
print #ti,"3 0 obj<</Type/Font/Name /T1/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj" print #ti,"4 0 obj<</Type/Font/Name /T2/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj" print #ti,"5 0 obj<</Type/Font/Name /T3/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj" print #ti,"6 0 obj<</Type/Font/Name /T4/BaseFont/Arial" print #ti,"/Subtype/Type1/Encoding /WinAnsiEncoding>>" print #ti,"endobj"
print #ti,"10 0 obj" print #ti,"<</Name /I1" print #ti,"/Type /XObject" print #ti,"/Subtype /Image" print #ti,"/Width 600" print #ti,"/Height 600" print #ti,"/Length 29779" print #ti,"/Filter /DCTDecode" print #ti,"/ColorSpace /DeviceRGB" print #ti,"/BitsPerComponent 8" print #ti,">> stream" print #ti,""
open "C:\ugly-pdf\webcam-image.jpg" for input as #fIn content$ =input$( #fIn, lof( #fIn)) close #fIn
print #ti,content$
print #ti,""
print #ti,"endstream" print #ti,"endobj"
print #ti,"xref" print #ti,"0 11"
print #ti,"trailer" print #ti,"<</Size 11" print #ti,"/Root 1 0 R" print #ti,"/Info 7 0 R" print #ti,"/ID[<5181383ede94727bcb32ac27ded71c68>" print #ti,"<5181383ede94727bcb32ac27ded71c68>]" print #ti,">>"
print #ti,"startxref" print #ti,"31959" print #ti,"%%EOF"
print #ti," "
close #ti
b$ = "C:\ugly-pdf\image.pdf"
RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
[snap]
ZWTEST=HEXDEC("&H400")
tg1=ZWTEST+61
tg2=ZWTEST+25
calldll #user32, "SendMessageA", cap as long,tg1 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,tg2 as long,0 as long,"c:\ugly-pdf\webcam-image.bmp" as PTR,r as long
loadbmp "landscape", "c:\ugly-pdf\webcam-image.bmp"
print #scr.gr, "background landscape";
print #scr.gr, "backgroundxy ";10;" ";10
print #scr.gr, "drawsprites"
''POWERSHELL.EXE -ExecutionPolicy bypass -File c:\ugly-pdf\makejpg.ps1
open "c:\ugly-pdf\makejpg.ps1" for output as #tp
print #tp,"[void] [System.Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Drawing"+chr$(34)+")" print #tp,"[void] [System.Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Windows.Forms"+chr$(34)+")"
print #tp," "
''print #tp,"param([switch]$Elevated)"
''print #tp,"function Test-Admin {" ''print #tp," $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())" ''print #tp," $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)" ''print #tp,"}"
''print #tp,"if ((Test-Admin) -eq $false) {" '' print #tp," if ($elevated) {" ''print #tp," # tried to elevate, did not work, aborting" '' print #tp," } else {" '' print #tp," Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "+chr$(34)+"{0}"+chr$(34)+" -elevated' -f ($myinvocation.MyCommand.Definition))" '' print #tp," }" '' print #tp," exit" ''print #tp,"}"
print #tp,"Write-Host "+chr$(34)+" "+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Basic..."+chr$(34)
print #tp,"$PSVersionTable"
print #tp,"[void] [Reflection.Assembly]::LoadWithPartialName("+chr$(34)+"System.Windows.Forms"+chr$(34)+")"
print #tp,"$DestDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"$SrcDir = "+chr$(34)+"C:\\ugly-pdf\"+chr$(34)+""
print #tp,"PushD $SrcDir"
print #tp,"Get-ChildItem *.bmp | "
print #tp," ForEach-Object{"
print #tp," $NewFileName = ( Join-Path $DestDir ($_.BaseName.SubString(0)+'.jpg' ))"
print #tp," $Picture = new-object System.Drawing.Bitmap($_.FullName)"
print #tp," $Picture.Save($NewFileName ,'JPEG') "
print #tp," }"
print #tp,"PopD"
print #tp,"Write-Host "+chr$(34)+"This is for creating a .jpg image..."+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Look for webcam-image.jpg in C:\ugly-pdf\ "+chr$(34)
print #tp,"Write-Host "+chr$(34)+"Greetings from code !"+chr$(34)
close #tp
RUN"POWERSHELL.EXE -ExecutionPolicy bypass -File c:\ugly-pdf\makejpg.ps1" ,hide
wait
[cam]
hw = hwnd(#scr)
reeks = _WS_VISIBLE OR _WS_CHILD
open "avicap32.dll" for DLL as #nd
calldll #nd , "capCreateCaptureWindowA", 0 as long, reeks as ptr,10 as long, 10 as long,400 as long, 300 as long,hw as long,0 as long,cap as long
calldll #user32, "SendMessageA", cap as long,1034 as long,0 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1077 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1076 as long,20 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1074 as long,1 as long,0 as long,r as long
calldll #user32, "SendMessageA", cap as long,1065 as long,0 as long,0 as long,r as long
wait
[d2]
print #scr2, "fill white"
print #scr2, "flush"
for dbl = 0 to fl step 1
print #scr2, "color blue"
print #scr2, "line ";x1(dbl);" ";y1(dbl);" ";x2(dbl);" ";y2(dbl);
next dbl
if status=1 then
print #scr2, "color blue"
print #scr2, "line ";x1(ln);" ";y1(ln);" ";MouseX;" ";MouseY;
end if
wait
[d]
status=status+1
if status=2 then
fl=fl+1
x2(fl)=MouseX
y2(fl)=MouseY
status=0
end if
if status=1 then
ln=ln+1
x1(ln)=MouseX
y1(ln)=MouseY
end if
wait
[b2]
open "Draw blue lines with mousedown..." for graphics_nsb as #scr2
print #scr2, "fill white"
print #scr2, "flush"
print #scr2, "when leftButtonDown [d]"
print #scr2, "down ; size 1"
print #scr2, "when mouseMove [d2]"
wait
[b1]
print #scr.te, "!lines cl" ;
open "C:\ugly-pdf\test.pdf" for output as #tf
print #tf,"%PDF-1.1"
print #tf,"%????"
print #tf,"1 0 obj"
print #tf,"<<"
print #tf,"/Kids [2 0 R]"
print #tf,"/Type /Pages"
print #tf,"/Count 1"
print #tf,">>"
print #tf,"endobj"
print #tf,"2 0 obj"
print #tf,"<<"
print #tf,"/Rotate 0"
print #tf,"/Parent 1 0 R"
print #tf,"/MediaBox [0 0 792 ";(cl*20)+40;"]"
print #tf,"/Resources 3 0 R"
print #tf,"/Type /Page" print #tf,"/XObject/I1 32 0 R " print #tf,"/Contents [4 0 R]"
print #tf,">>"
print #tf,"endobj"
print #tf,"32 0 obj " print #tf,"<</Name /I1" print #tf,"/Type /XObject" print #tf,"/Subtype" print #tf,"/Image" print #tf,"/Width 300" print #tf,"/Height 150" print #tf,"/Length 80000" print #tf,"/Filter" print #tf,"/DCTDecode" print #tf,"/ColorSpace" print #tf,"/DeviceRGB" print #tf,"/BitsPerComponent 8>>" print #tf,"stream"
open "C:\ugly-pdf\webcam-image.jpg" for input as #fIn content$ =input$( #fIn, lof( #fIn)) close #fIn
print #tf,content$
print #tf,"endstream"
print #tf,"endobj"
print #tf,"3 0 obj "
print #tf,"<<"
print #tf,"/Font"
print #tf,"<<"
print #tf,"/F0"
print #tf,"<<"
print #tf,"/BaseFont /Arial"
print #tf,"/Subtype /Type1"
print #tf,"/Type /Font"
print #tf,">>"
print #tf,">>"
print #tf,">>"
print #tf,"endobj "
print #tf,"4 0 obj "
print #tf,"<<"
print #tf,"/Length 121"
print #tf,"/Filter/DCTDecode"
print #tf,"/Type/XObject/"
print #tf,"Length 33555/"
print #tf,"Height 413/"
print #tf,"BitsPerComponent 8/"
print #tf,"Subtype/Image/'"
print #tf,"Width 640"
print #tf,"stream"
print #tf,"endstream"
print #tf,">>"
print #tf,"stream"
print #tf,"0.5 g"
print #tf,"0 0 0 rg"
print #tf,"BT"
print #tf,"/F0 20 Tf"
print #tf,"1 0 0 1 60 ";(cl*20)+40;" Tm"
print #tf,"20 TL"
print #tf,"() Tj T*"
for i = 0 to cl step 1
print #scr.te, "!line ";i;" linete$" ;
print #tf,"2 Tr"
print #tf,"(";linete$;") Tj T*"
next i
print #tf,"ET"
for dl = 1 to fl step 1
print #tf,"0 0 1 rg"
print #tf," ";x1(dl)+xp;" ";(cl*20)-y1(dl)+yp;" m"
print #tf," ";x2(dl)+xp;" ";(cl*20)-y2(dl)+yp;" l"
print #tf," f"
next dl
print #tf,"endstream"
print #tf,"endobj"
print #tf,"5 0 obj"
print #tf,"<<"
print #tf,"/Pages 1 0 R"
print #tf,"/Type /Catalog"
print #tf,">>"
print #tf,"endobj xref"
print #tf,"0 6"
''rint #tf,"0000000000 65535 f"
''print #tf,"0000000015 00000 n"
''print #tf,"0000000074 00000 n"
''print #tf,"0000000192 00000 n"
''print #tf,"0000000291 00000 n"
''print #tf,"0000000466 00000 n"
print #tf,"trailer"
print #tf,""
print #tf,"<<"
print #tf,"/Root 5 0 R"
print #tf,"/Size 6"
print #tf,">>"
print #tf,"startxref"
print #tf,"516"
print #tf,"%%EOF"
close #tf
b$ = "C:\ugly-pdf\test.pdf"
RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
|
|
|
Post by Rod on Sept 12, 2022 9:14:00 GMT -5
Image.pdf now creates a simple pdf with image at top left. Ugly.pdf creates a pdf but no image. Lots in the code for me to play with as I am not really interested in pdf output.
|
|