Jump to content

Search the Community

Showing results for tags 'MPDF'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello all I am trying to create img2pdf program using The >MPDF UDF. The base of my code is dirived from the img2pdf example. I can make the image itself the a custom size but not the page itself. Any ideas? #include "..\MPDF_UDF.au3" _SelectImages() Func _SelectImages() Local $var = FileOpenDialog("Select images", @ScriptDir & "\", "Images (*.jpg;*.bmp;*gif;*png;*tif;*ico)", 4) If @error Then MsgBox(4096, "", "No File(s) chosen") Else Local $aImgs = StringSplit($var, "|", 3) Dim $cHeight[1] $cHeight[0] = 0 Dim $cWidth[1] $cWidth[0] = 0 _GDIPlus_Startup() For $i = 1 To UBound($aImgs) - 1 $oGdi = _GDIPlus_ImageLoadFromFile($aImgs[0] & "\" & $aImgs[$i]) If @error Then MsgBox(0, "Error", @error) Exit EndIf _ArrayAdd($cWidth, _GDIPlus_ImageGetWidth($oGdi)) _ArrayAdd($cHeight, _GDIPlus_ImageGetHeight($oGdi)) Next _GDIPlus_Shutdown() _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_PT) _SetZoomMode($PDF_ZOOM_CUSTOM, 90) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\Image2PDF.pdf") If UBound($aImgs) <> 1 Then ;=== load resources used in pdf === For $i = 1 To UBound($aImgs) - 1 _LoadResImage("img" & $i, $aImgs[0] & "\" & $aImgs[$i]) Next ;load each image on it's own page For $i = 1 To UBound($aImgs) - 1 _SetPaperSize("CUSTOM",$cWidth[$i],$cHeight[$i]) _BeginPage() _InsertImage("img" & $i, 0, 0,$cWidth[$i], $cHeight[$i]) _EndPage() Next Else _LoadResImage("taietel", $aImgs[0]) _BeginPage() ;scale image to paper size! _InsertImage("taietel", 0, 0, _GetPageWidth() / _GetUnit(), _GetPageHeight() / _GetUnit()) _EndPage() EndIf ;then, finally, write the buffer to disk _ClosePDFFile() EndIf EndFunc ;==>_SelectImages ps I have included the my source the udf and the images I am using to test it. Img2Pdf.zip
×
×
  • Create New...