Chimp

Perpetual Calendar (generated in pdf format)

17 posts in this topic

#1 ·  Posted (edited)

This script generates a calendar of 12 pages in pdf format (ready to be printed if you want)

it include for each month also the previous and the next month on the same page.

It makes use of the "MPDF_UDF.au3" udf by taietel from >this topic
you must download that udf and save it in the same folder with this script.
(it seems that the version modified by bdr529 from post #231 is more updated.

I used that one with my script.)

Happy new year

; Create a Calendar in pdf
;
; download the "MPDF_UDF.au3" udf from here: http://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/?p=1158973
; it is at the bottom of post #231. Download and save it in the same path of this script.
#include "MPDF_UDF.au3"
;
#include <date.au3>
$sYear = "2015" ; <--- change the year if you need another
$sMonths = "January,February,March,April,May,June,July,August,September,October,November,December"
$sDaysOfWeek = "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday"
; --- just change above names to localize (following names are italian for example) ---
; $sMonths = "Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre"
; $sDaysOfWeek = "Lunedì,Martedì,Mercoledì,Giovedì,Venerdì,Sabato,Domenica"
; -------------------------------------------------------------------------------------
Local $aMonths = StringSplit($sMonths, ","), $aDaysOfWeek = StringSplit($sDaysOfWeek, ",")
Local $aPreviousMonth, $aNextMonth, $iDayOfWeek, $aColors[2] = ["0x000000", "0xFF0000"], $aDummy
;
;set the properties for the pdf
_SetTitle("Calendar " & $sYear)
_SetSubject("Calendar made with AutoIt (www.autoitscript.com)")
_SetKeywords("calendar, pdf")
_OpenAfter(True);open after generation
_SetUnit($PDF_UNIT_CM)
_SetPaperSize("A4")
_SetZoomMode($PDF_ZOOM_FULLPAGE)
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
_SetLayoutMode($PDF_LAYOUT_CONTINOUS)

;initialize the pdf
_InitPDF(@ScriptDir & "\Calendar_" & $sYear & ".pdf")

;=== load used font(s) ===
_LoadFontTT("_TimesNR", $PDF_FONT_TIMES)
_LoadFontTT("_TimesNRB", $PDF_FONT_TIMES, $PDF_FONT_BOLD)
;
For $Month = 1 To 12 ; Generate 12 months
    _BeginPage() ; begin page
    ; --- create areas that will contains days -----------------------------------------------
    _InsertTable(00.50, 00.50, 20.00, 28.50, 1, 1, 0xB0B0B0, 0xB0B0B0) ; background
    _InsertTable(00.80, 26.10, 19.40, 02.60, 1, 1, 0xFF0000, 0x000000, 0.03) ; main month title
    _InsertTable(00.80, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; previous month (the little on the left)
    _InsertTable(00.80, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of previous month
    _InsertTable(03.80, 00.80, 13.40, 25.00, 2, 16, 0xFFFFFF, 0x000000) ; this month
    _DrawLine(03.80, 00.80, 17.20, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0) ; border of this month
    _DrawLine(17.20, 00.80, 17.20, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _DrawLine(17.20, 25.80, 03.80, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _DrawLine(03.80, 25.80, 03.80, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _InsertTable(17.50, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; next month (the little on the right)
    _InsertTable(17.50, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of next month
    ; --- now fill the areas with the dates --------------------------------------------------
    _InsertRenderedText(10.5, 27, StringUpper($aMonths[$Month]) & " " & $sYear, "_TimesNR", 50, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Main Month
    _DateTimeSplit(_DateAdd("M", -1, $sYear & "/" & $Month & "/1"), $aPreviousMonth, $aDummy) ; Previous Month
    _InsertRenderedText(2.15, 25.28, StringUpper($aMonths[$aPreviousMonth[2]]) & " " & $aPreviousMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Previous Month
    _DateTimeSplit(_DateAdd("M", 1, $sYear & "/" & $Month & "/1"), $aNextMonth, $aDummy) ; Next Month
    _InsertRenderedText(18.85, 25.28, StringUpper($aMonths[$aNextMonth[2]]) & " " & $aNextMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Next Month
    For $i = 1 To 31
        If _DateIsValid($aPreviousMonth[1] & "/" & $aPreviousMonth[2] & "/" & $i) Then ; previous month
            $iDayOfWeek = _DateToDayOfWeekISO($aPreviousMonth[1], $aPreviousMonth[2], $i)
            _InsertRenderedText(01.80, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Previous Month's days
            _InsertRenderedText(02.00, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iDayOfWeek], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf
        If _DateIsValid($aNextMonth[1] & "/" & $aNextMonth[2] & "/" & $i) Then ; next month
            $iDayOfWeek = _DateToDayOfWeekISO($aNextMonth[1], $aNextMonth[2], $i)
            _InsertRenderedText(18.50, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Next Month's days
            _InsertRenderedText(18.70, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iDayOfWeek], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf

        If _DateIsValid($sYear & "/" & $Month & "/" & $i) Then ; main month
            $iDayOfWeek = _DateToDayOfWeekISO($sYear, $Month, $i)
            _InsertRenderedText(05.30 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $i, "_TimesNRB", 24, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
            _InsertRenderedText(05.60 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $aDaysOfWeek[$iDayOfWeek], "_TimesNR", 22, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf

        If $i < 31 Then ; separator line between days in previous and next month
            _DrawLine(01.00, 25 - 0.78125 * $i, 03.30, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0)
            _DrawLine(17.70, 25 - 0.78125 * $i, 20.00, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0)
        EndIf
    Next
    _EndPage() ; next month will be in a new page
Next ; next month
;write the buffer to disk
_ClosePDFFile()
; --- Functions ---
Func _InsertTable($iX, $iY, $iW = 0, $iH = 0, $iCols = 0, $iRows = 0, $lFillColor = 0xFFFFFF, $lBorderColor = 0x000000, $fThickness = 0.01)
    Local $iPgW = Round(_GetPageWidth() / _GetUnit(), 1)
    Local $iPgH = Round(_GetPageHeight() / _GetUnit(), 1)
    If $iW = 0 Then $iW = $iPgW - $iX - 2
    If $iH = 0 Then $iH = $iPgH - $iY - 2
    Local $iColW = $iW / $iCols
    Local $iRowH = $iH / $iRows
    _SetColourStroke($lBorderColor)
    For $i = 0 To $iRows - 1
        For $j = 0 To $iCols - 1
            _Draw_Rectangle($iX + $j * $iColW, $iY + $iH - ($i + 1) * $iRowH, $iColW, $iRowH, $PDF_STYLE_STROKED, 0, $lFillColor, $fThickness)
        Next
    Next
    _SetColourStroke(0)
EndFunc   ;==>_InsertTable

Func _Iif($fTest, $vTrueVal, $vFalseVal)
    If $fTest Then
        Return $vTrueVal
    Else
        Return $vFalseVal
    EndIf
EndFunc   ;==>_Iif

edit:

p.s. if you get this error: ERROR: _Iif() already defined.

then just remove the _Iif() function from the bottom of this script

this occurs with older AutoIt versions

Edited by Chimp
restored broken links (due to forum upgrade)
1 person likes this

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites



Nicely done Chimp !  :thumbsup:

Just rename _lif function to _lifex.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Nicely done Chimp !  :thumbsup:

Just rename _lif function to _lifex.

 

Thanks :)


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Nice.

you can use:

#include <date.au3>
#include <MsgBoxConstants.au3>
#include <array.au3>

Local $aDaysOfWeek[7]
For $iDay = 1 To 7
    $aDaysOfWeek[$iDay - 1] = _DateDayOfWeek($iDay, $DMW_LOCALE_LONGNAME)
Next
_ArrayDisplay($aDaysOfWeek, '$aDaysOfWeek')

Local $aMonths[12]
For $iDay = 1 To 12
    $aMonths[$iDay - 1] = _DateToMonth($iDay, $DMW_LOCALE_LONGNAME)
Next
_ArrayDisplay($aMonths, '$aMonths')

EDIT:

script modyfication - added $aMonths

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Nice work!  :thumbsup:

I added some more languages:

; Create a Calendar in pdf
;
; download the "MPDF_UDF.au3" udf from here: http://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/?p=1158973
; it is at the bottom of post #231. Download and save it in the same path of this script.
#include "MPDF_UDF.au3"
;
#include <date.au3>
$sYear = "2015" ; <--- change the year if you need another

; -------------------------------------------------------------------------------------
Local $iLang = 2
Local $aMonths[6][12] = [["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], _ ;english
                         ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], _ ;italian
                         ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], _ ;german
                         ["Ocak", "Subat", "Mart", "Nisan", "Mayis", "Haziran", "Temmuz", "Agustos", "Eylül", "Ekim", "Kasim", "Aralik"], _ ;turkish
                         ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], _ ;french
                         ["Enero", "Febrero", "Marcha", "Abril", "Puede", "Juni", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]] ;spanish

Local $aDaysOfWeek[6][7] = [["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], _
                            ["Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"], _
                            ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"], _
                            ["Pazartesi", "Sali", "Çarsamba", "Persembe", "Cuma", "Cumartesi", "Pazar"], _
                            ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"], _
                            ["Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"]]

Local $aPreviousMonth, $aNextMonth, $iDayOfWeek, $aColors[2] = ["0x000000", "0xFF0000"], $aDummy
;
;set the properties for the pdf
_SetTitle("Calendar " & $sYear)
_SetSubject("Calendar made with AutoIt (www.autoitscript.com)")
_SetKeywords("calendar, pdf")
_OpenAfter(True);open after generation
_SetUnit($PDF_UNIT_CM)
_SetPaperSize("A4")
_SetZoomMode($PDF_ZOOM_FULLPAGE)
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
_SetLayoutMode($PDF_LAYOUT_CONTINOUS)

;initialize the pdf
_InitPDF(@ScriptDir & "\Calendar_" & $sYear & ".pdf")

;=== load used font(s) ===
_LoadFontTT("_TimesNR", $PDF_FONT_TIMES)
_LoadFontTT("_TimesNRB", $PDF_FONT_TIMES, $PDF_FONT_BOLD)
;
For $Month = 1 To 12 ; Generate 12 months
    _BeginPage() ; begin page
    ; --- create areas that will contains days -----------------------------------------------
    _InsertTable(00.50, 00.50, 20.00, 28.50, 1, 1, 0xB0B0B0, 0xB0B0B0) ; background
    _InsertTable(00.80, 26.10, 19.40, 02.60, 1, 1, 0xFF0000, 0x000000, 0.03) ; main month title
    _InsertTable(00.80, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; previous month (the little on the left)
    _InsertTable(00.80, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of previous month
    _InsertTable(03.80, 00.80, 13.40, 25.00, 2, 16, 0xFFFFFF, 0x000000) ; this month
    _DrawLine(03.80, 00.80, 17.20, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0) ; border of this month
    _DrawLine(17.20, 00.80, 17.20, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _DrawLine(17.20, 25.80, 03.80, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _DrawLine(03.80, 25.80, 03.80, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _InsertTable(17.50, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; next month (the little on the right)
    _InsertTable(17.50, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of next month
    ; --- now fill the areas with the dates --------------------------------------------------
    _InsertRenderedText(10.5, 27, StringUpper($aMonths[$iLang][$Month - 1]) & " " & $sYear, "_TimesNR", 50, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Main Month
    _DateTimeSplit(_DateAdd("M", -1, $sYear & "/" & $Month & "/1"), $aPreviousMonth, $aDummy) ; Previous Month
    _InsertRenderedText(2.15, 25.28, StringUpper($aMonths[$iLang][$aPreviousMonth[2] - 1]) & " " & $aPreviousMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Previous Month
    _DateTimeSplit(_DateAdd("M", 1, $sYear & "/" & $Month & "/1"), $aNextMonth, $aDummy) ; Next Month
    _InsertRenderedText(18.85, 25.28, StringUpper($aMonths[$iLang][$aNextMonth[2] - 1]) & " " & $aNextMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Next Month
    For $i = 1 To 31
        If _DateIsValid($aPreviousMonth[1] & "/" & $aPreviousMonth[2] & "/" & $i) Then ; previous month
            $iDayOfWeek = _DateToDayOfWeekISO($aPreviousMonth[1], $aPreviousMonth[2], $i)
            _InsertRenderedText(01.80, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Previous Month's days
            _InsertRenderedText(02.00, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iLang][$iDayOfWeek - 1], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf
        If _DateIsValid($aNextMonth[1] & "/" & $aNextMonth[2] & "/" & $i) Then ; next month
            $iDayOfWeek = _DateToDayOfWeekISO($aNextMonth[1], $aNextMonth[2], $i)
            _InsertRenderedText(18.50, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Next Month's days
            _InsertRenderedText(18.70, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iLang][$iDayOfWeek - 1], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf

        If _DateIsValid($sYear & "/" & $Month & "/" & $i) Then ; main month
            $iDayOfWeek = _DateToDayOfWeekISO($sYear, $Month, $i)
            _InsertRenderedText(05.30 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $i, "_TimesNRB", 24, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
            _InsertRenderedText(05.60 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $aDaysOfWeek[$iLang][$iDayOfWeek - 1], "_TimesNR", 22, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf

        If $i < 31 Then ; separator line between days in previous and next month
            _DrawLine(01.00, 25 - 0.78125 * $i, 03.30, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0)
            _DrawLine(17.70, 25 - 0.78125 * $i, 20.00, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0)
        EndIf
    Next
    _EndPage() ; next month will be in a new page
Next ; next month
;write the buffer to disk
_ClosePDFFile()
; --- Functions ---
Func _InsertTable($iX, $iY, $iW = 0, $iH = 0, $iCols = 0, $iRows = 0, $lFillColor = 0xFFFFFF, $lBorderColor = 0x000000, $fThickness = 0.01)
    Local $iPgW = Round(_GetPageWidth() / _GetUnit(), 1)
    Local $iPgH = Round(_GetPageHeight() / _GetUnit(), 1)
    If $iW = 0 Then $iW = $iPgW - $iX - 2
    If $iH = 0 Then $iH = $iPgH - $iY - 2
    Local $iColW = $iW / $iCols
    Local $iRowH = $iH / $iRows
    _SetColourStroke($lBorderColor)
    For $i = 0 To $iRows - 1
        For $j = 0 To $iCols - 1
            _Draw_Rectangle($iX + $j * $iColW, $iY + $iH - ($i + 1) * $iRowH, $iColW, $iRowH, $PDF_STYLE_STROKED, 0, $lFillColor, $fThickness)
        Next
    Next
    _SetColourStroke(0)
EndFunc   ;==>_InsertTable

Func _Iif($fTest, $vTrueVal, $vFalseVal)
    If $fTest Then
        Return $vTrueVal
    Else
        Return $vFalseVal
    EndIf
EndFunc   ;==>_Iif

I hope the translations are ok.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Nice.

you can use:

#include <date.au3>
#include <MsgBoxConstants.au3>
#include <array.au3>

Local $aDaysOfWeek[7]
For $iDay = 1 To 7
    $aDaysOfWeek[$iDay - 1] = _DateDayOfWeek($iDay, $DMW_LOCALE_LONGNAME)
Next
_ArrayDisplay($aDaysOfWeek, '$aDaysOfWeek')

Local $aMonths[12]
For $iDay = 1 To 12
    $aMonths[$iDay - 1] = _DateToMonth($iDay, $DMW_LOCALE_LONGNAME)
Next
_ArrayDisplay($aMonths, '$aMonths')

EDIT:

script modyfication - added $aMonths

 

Thanks mLipok,

I knew that the new _DateDayOfWeek() function can return localized names, but I preferred to use names entered by user in listing so to be able to use languages different from the local OS language.

thanks again for the suggestion :)

 

Nice work!  :thumbsup:

I added some more languages:

; Create a Calendar in pdf
;
; download the "MPDF_UDF.au3" udf from here: http://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/?p=1158973
; it is at the bottom of post #231. Download and save it in the same path of this script.
#include "MPDF_UDF.au3"
;
#include <date.au3>
$sYear = "2015" ; <--- change the year if you need another

; -------------------------------------------------------------------------------------
Local $iLang = 2
Local $aMonths[6][12] = [["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], _ ;english
                         ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], _ ;italian
                         ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], _ ;german
                         ["Ocak", "Subat", "Mart", "Nisan", "Mayis", "Haziran", "Temmuz", "Agustos", "Eylül", "Ekim", "Kasim", "Aralik"], _ ;turkish
                         ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], _ ;french
                         ["Enero", "Febrero", "Marcha", "Abril", "Puede", "Juni", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]] ;spanish

Local $aDaysOfWeek[6][7] = [["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], _
                            ["Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"], _
                            ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"], _
                            ["Pazartesi", "Sali", "Çarsamba", "Persembe", "Cuma", "Cumartesi", "Pazar"], _
                            ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"], _
                            ["Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"]]

Local $aPreviousMonth, $aNextMonth, $iDayOfWeek, $aColors[2] = ["0x000000", "0xFF0000"], $aDummy
;
;set the properties for the pdf
_SetTitle("Calendar " & $sYear)
_SetSubject("Calendar made with AutoIt (www.autoitscript.com)")
_SetKeywords("calendar, pdf")
_OpenAfter(True);open after generation
_SetUnit($PDF_UNIT_CM)
_SetPaperSize("A4")
_SetZoomMode($PDF_ZOOM_FULLPAGE)
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
_SetLayoutMode($PDF_LAYOUT_CONTINOUS)

;initialize the pdf
_InitPDF(@ScriptDir & "\Calendar_" & $sYear & ".pdf")

;=== load used font(s) ===
_LoadFontTT("_TimesNR", $PDF_FONT_TIMES)
_LoadFontTT("_TimesNRB", $PDF_FONT_TIMES, $PDF_FONT_BOLD)
;
For $Month = 1 To 12 ; Generate 12 months
    _BeginPage() ; begin page
    ; --- create areas that will contains days -----------------------------------------------
    _InsertTable(00.50, 00.50, 20.00, 28.50, 1, 1, 0xB0B0B0, 0xB0B0B0) ; background
    _InsertTable(00.80, 26.10, 19.40, 02.60, 1, 1, 0xFF0000, 0x000000, 0.03) ; main month title
    _InsertTable(00.80, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; previous month (the little on the left)
    _InsertTable(00.80, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of previous month
    _InsertTable(03.80, 00.80, 13.40, 25.00, 2, 16, 0xFFFFFF, 0x000000) ; this month
    _DrawLine(03.80, 00.80, 17.20, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0) ; border of this month
    _DrawLine(17.20, 00.80, 17.20, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _DrawLine(17.20, 25.80, 03.80, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _DrawLine(03.80, 25.80, 03.80, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0)
    _InsertTable(17.50, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; next month (the little on the right)
    _InsertTable(17.50, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of next month
    ; --- now fill the areas with the dates --------------------------------------------------
    _InsertRenderedText(10.5, 27, StringUpper($aMonths[$iLang][$Month - 1]) & " " & $sYear, "_TimesNR", 50, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Main Month
    _DateTimeSplit(_DateAdd("M", -1, $sYear & "/" & $Month & "/1"), $aPreviousMonth, $aDummy) ; Previous Month
    _InsertRenderedText(2.15, 25.28, StringUpper($aMonths[$iLang][$aPreviousMonth[2] - 1]) & " " & $aPreviousMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Previous Month
    _DateTimeSplit(_DateAdd("M", 1, $sYear & "/" & $Month & "/1"), $aNextMonth, $aDummy) ; Next Month
    _InsertRenderedText(18.85, 25.28, StringUpper($aMonths[$iLang][$aNextMonth[2] - 1]) & " " & $aNextMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Next Month
    For $i = 1 To 31
        If _DateIsValid($aPreviousMonth[1] & "/" & $aPreviousMonth[2] & "/" & $i) Then ; previous month
            $iDayOfWeek = _DateToDayOfWeekISO($aPreviousMonth[1], $aPreviousMonth[2], $i)
            _InsertRenderedText(01.80, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Previous Month's days
            _InsertRenderedText(02.00, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iLang][$iDayOfWeek - 1], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf
        If _DateIsValid($aNextMonth[1] & "/" & $aNextMonth[2] & "/" & $i) Then ; next month
            $iDayOfWeek = _DateToDayOfWeekISO($aNextMonth[1], $aNextMonth[2], $i)
            _InsertRenderedText(18.50, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Next Month's days
            _InsertRenderedText(18.70, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iLang][$iDayOfWeek - 1], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf

        If _DateIsValid($sYear & "/" & $Month & "/" & $i) Then ; main month
            $iDayOfWeek = _DateToDayOfWeekISO($sYear, $Month, $i)
            _InsertRenderedText(05.30 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $i, "_TimesNRB", 24, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
            _InsertRenderedText(05.60 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $aDaysOfWeek[$iLang][$iDayOfWeek - 1], "_TimesNR", 22, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7])
        EndIf

        If $i < 31 Then ; separator line between days in previous and next month
            _DrawLine(01.00, 25 - 0.78125 * $i, 03.30, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0)
            _DrawLine(17.70, 25 - 0.78125 * $i, 20.00, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0)
        EndIf
    Next
    _EndPage() ; next month will be in a new page
Next ; next month
;write the buffer to disk
_ClosePDFFile()
; --- Functions ---
Func _InsertTable($iX, $iY, $iW = 0, $iH = 0, $iCols = 0, $iRows = 0, $lFillColor = 0xFFFFFF, $lBorderColor = 0x000000, $fThickness = 0.01)
    Local $iPgW = Round(_GetPageWidth() / _GetUnit(), 1)
    Local $iPgH = Round(_GetPageHeight() / _GetUnit(), 1)
    If $iW = 0 Then $iW = $iPgW - $iX - 2
    If $iH = 0 Then $iH = $iPgH - $iY - 2
    Local $iColW = $iW / $iCols
    Local $iRowH = $iH / $iRows
    _SetColourStroke($lBorderColor)
    For $i = 0 To $iRows - 1
        For $j = 0 To $iCols - 1
            _Draw_Rectangle($iX + $j * $iColW, $iY + $iH - ($i + 1) * $iRowH, $iColW, $iRowH, $PDF_STYLE_STROKED, 0, $lFillColor, $fThickness)
        Next
    Next
    _SetColourStroke(0)
EndFunc   ;==>_InsertTable

Func _Iif($fTest, $vTrueVal, $vFalseVal)
    If $fTest Then
        Return $vTrueVal
    Else
        Return $vFalseVal
    EndIf
EndFunc   ;==>_Iif

I hope the translations are ok.

Br,

UEZ

 

Thanks UEZ

useful enhancement...

Just changing  the $iLang variable's value located near the beginning of your script to change the language... nice :)

p.s.

$iLang = 0 ; english

$iLang = 1 ; italian

$iLang = 2 ; german

$iLang = 3 ; turkish

$iLang = 4 ; french

$iLang = 5 ; spanish


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi,

Nice

Dutch translation

["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"]

["Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"]
 

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

Hi,

Nice

Dutch translation

["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"]

["Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"]

 

 

Thanks :)


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Nice work!  :thumbsup:

I added some more languages:

Local $aMonths[6][12] = [["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], _ ;english
                         ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], _ ;italian
                         ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], _ ;german
                         ["Ocak", "Subat", "Mart", "Nisan", "Mayis", "Haziran", "Temmuz", "Agustos", "Eylül", "Ekim", "Kasim", "Aralik"], _ ;turkish
                         ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], _ ;french
                         ["Enero", "Febrero", "Marcha", "Abril", "Puede", "Juni", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]] ;spanish
I hope the translations are ok.

 

My daughter who learns Spanish at school, has noticed some errors !  :P

 

March is not Marcha but Marzo
 
May is not Puede but Mayo
 
June is not Juni but Junio
 
;)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Don't judge me - judge Google translator ;)

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Don't judge me - judge Google translator ;)

Br,

UEZ

 

I judge no one
I just bring my contribution
 
Happy New Year Herr UEZ !  :sorcerer:

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Merci monsieur wakillon. Also my best wishes to you and your family.  :rolleyes:

I can speak 3 languages but not french, spanish, italian, ... I've to trust Google Translator but the translation isn't good sometimes.

Br,
UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

The translator got it right, it just didn't get that you were referring to the months of the year. Puede has the meaning of may as in "it may happen", Mayo is the month of May. Marcha is the word for "to march" and Marzo is the month of March.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Google Translate do not take in count the context of the request

You can paste all english month names (for help him to get the context) but you'll get a translation error on March !

This is not the first time that I find Bing translator more reliable.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

would be cool if we could generate birthday calenders with it, you know, the one with images ontop and the table beneath it :P


and proud of it!!!

Share this post


Link to post
Share on other sites

Shouldn't be too much work on your part to modify this to do that. ;)


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

added Polish translation:

Local $aMonths[7][12] = [["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], _ ;english
                         ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], _ ;italian
                         ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], _ ;german
                         ["Ocak", "Subat", "Mart", "Nisan", "Mayis", "Haziran", "Temmuz", "Agustos", "Eylül", "Ekim", "Kasim", "Aralik"], _ ;turkish
                         ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre"], _ ;french
                         ["Enero", "Febrero", "Marcha", "Abril", "Puede", "Juni", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], _ ;spanish
                         ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"]] ;polish

Local $aDaysOfWeek[7][7] = [["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], _
                            ["Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato", "Domenica"], _
                            ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"], _
                            ["Pazartesi", "Sali", "Çarsamba", "Persembe", "Cuma", "Cumartesi", "Pazar"], _
                            ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"], _
                            ["Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"], _
                            ["Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota", "Niedziela"]]

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • mLipok
      By mLipok
      Here:
      https://github.com/nachbar/TRichViewToPdfUsingDebenu/blob/master/Unit1.cpp
      I found a code in C++ for file format conversion from RTF to PDF with using Debenu QuickPDF.
      I know how to use Debenu QuickPDF in AutoIt .
      My question is about RTF part of this code:
       
      HDC hdcNew = debenu->GetCanvasDC( RTFPRINTINGDOTSPERINCH * RTFPAGEWIDTHININCHES, RTFPRINTINGDOTSPERINCH * RTFPAGEHEIGHTININCHES); canvas = new TCanvas; canvas->Handle = hdcNew; RVReportHelper1->DrawPage( PageCounter, canvas, true, RTFPRINTINGDOTSPERINCH * RTFPAGEHEIGHTININCHES); // LastPageHeight);  
      First there is hdcNew declaration , and this is not the problem.
      My problem is in converting the following code snippet, to AutoIt
      canvas = new TCanvas; canvas->Handle = hdcNew; RVReportHelper1->DrawPage( PageCounter, canvas, true, RTFPRINTINGDOTSPERINCH * RTFPAGEHEIGHTININCHES); // LastPageHeight);
      If you remember, I created RTFPrinter sometime ago. But it was some time ago , and created by trial and error, rather than in-depth analysis.
      Also, it was just a modification of another script, not my own work from scratch.
      So now I'm looking for help how to adapt this code snippet to AutoIt.
      Any tips ?
       
      Regards,
      mLIpok
       
    • Kiran_L
      By Kiran_L
      Hi guys,
       
      I am trying to read a pdf file with unstructured data. I dontot know how to handle pdf activities in AutoIt,
      Can you help me with any UDF to open the PDF and read the doc.
       
      Thanks for your time.
       
    • Mag91
      By Mag91
      Hey Community,
      cause im too new in the Auto it world i will try it with the your help. hopefully.
      I woud like to know how i can handle my Problem.
      ----
      I have a Excel Data with 362 random numbers.
      For Example:
      1166642335374 1172899897343
      .....
      this numbers are a part of the filepath ...example
      D:\Projekte\1166_64233_5374
      as u can see its the first number of the Excel data. After the first 4 numbers it shoud make a "_" than another 5 "_"
      This is my first question. How can i handle this to make it Shell execute.
       
      --------
      Second question:
      If i am in the path.
      For Example:
      D:\Projekte\1166_64233_5374
      the code shoud search for specific PDF Files.
      They are named like: 0050569E364B1ED79B900F73E62660EC.pdf
      the first 15 letters are always the same
      0050569E364B1ED
      when he found this data he has to copy it on a Folder on the Desktop.
      (There can also be 2 or 3 pdfs in one Folder with this letters)
      ----
      Please give me some help :-)
       
       
       
       
       
       
    • Mag91
      By Mag91
      Hey Everybody,
      as you know im on a very low autoit-level.
      My question is: How can i read all PDFs from a Folder wich is open and copy them to a Folder on a Desktop.
       
      The Folder wich contains the PDFs is variable Z:\Projektls\"*"*"*EVERYTIME ANOTHER ENDING"*"*"*"*"
      There can be 1 PDF or even 15 PDFs.
      i tried it with _FileListToArray and _FileCopy but i Need some help to understand this language
       
      THANKS!
       
    • Skeletor
      By Skeletor
      Hi Guys,
      I've been reading this post ...
      When I came accross the examples, non of them had what I was looking for.
      I basically want to "snapshot" my GUI's multiple tabs and send them into the pdf.
      A little nudge from you guys would be great.
      Im really stuck with this one, therefore I have no code.
      Lets discuss or point me in a right direction... thanks alot