Jump to content

Recommended Posts

Posted (edited)
  On 4/23/2015 at 10:05 AM, mLipok said:

 

Я думаю, что это сделано:

Func _Examples_For_Lelikkeo ()

    #cs
        Член AuotIt Lelikkeo обратиться за помощью:

        Помоги мне, пожалуйста, сделать простой пример, используя бесплатный библиотека (Lite) и особенности:
        - Создать форматы PDF файлов формата А4, A3, A2, A1, A0.
        - Изменение ориентации листа.
        - Ввод текста с указанием размера и координаты расположения текста на листе.
        - Рисование линий с указанием начала и конца линии.
        - Объединить несколько PDF-файлов в один.

        Запрос Ссылка
        http://www.autoitscript.com/forum/topic/160875-debenu-quick-pdf-library-udf/page-2#entry1240977

    #ce

    _QPDF_UseErrorHandler ()
    Местное $ oQP

    Если _QPDF_CreateObjectAndUnlock ($ oQP) = 2, то

        ; Установите происхождения для рисования координат. В этом случае мы будем рисовать координаты в левом верхнем углу страницы.
        ; http://www.debenu.com/docs/pdf_library_reference/SetOrigin.php
        $ OQP.SetOrigin ($ __ eQPDF_SORIGIN_TopLeft);

        ; http://www.debenu.com/docs/pdf_library_reference/SetMeasurementUnits.php
        $ oQP.SetMeasurementUnits ($ __ eQPDF_MUNITS_Milimeters)

        ; Установите Размер страницы формата А3 с Пейзаж
        ; http://www.debenu.com/docs/pdf_library_reference/SetPageSize.php
        $ OQP.SetPageSizes ('A3 Пейзаж ")

        ; Установить размер Page А3 ориентации страницы по умолчанию
        ; http://www.debenu.com/docs/pdf_library_reference/SetPageSize.php
        $ oQP.SetPageSizes ('A4')

        ; http://www.debenu.com/docs/pdf_library_reference/SetTextSize.php
        $ OQP.SetTextSize (10);

        ; Нарисуйте обычный текст
        ; http://www.debenu.com/docs/pdf_library_reference/DrawText.php
        $ OQP.DrawText (25, 25, "Это пример для Lelikkeo Запрос");

        #cs
            К сожалению SetLineWidth и DrawLine не доступны в Lite версии

            ; http://www.debenu.com/docs/pdf_library_reference/SetLineWidth.php
            $ OQP.SetLineWidth (1)

            ; рисование линий, указывающих на начало и конец линии.
            ; http://www.debenu.com/docs/pdf_library_reference/DrawLine.php
            $ OQP.DrawLine (20,50,200,80);
        #ce

        ; http://www.debenu.com/docs/pdf_library_reference/SaveToFile.php
        $ OQP.SaveToFile (ScriptDir и '\ QP_Lelikkeo_Exmaple.pdf');

        ShellExecute (ScriptDir и '\ QP_Lelikkeo_Exmaple.pdf')

        ; Этот следующий пример не только функцию в UDF - но он может быть использован в качестве примера
        _QPDF_MergeFiles_Lite ()

    EndIf

EndFunc; ==> _ Examples_For_Lelikkeo

 

Thank you very much!!!! )))) :thumbsup:  :thumbsup:  :thumbsup: 

Edited by Lelikkeo
Posted

you're welcome

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Try to use TIDY.

It shows you that you do not close 

Func _Examples_For_Lelikkeo()
....
....
....
....
EndFunc ; <<<< this is missing in your modyfication

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 4/23/2015 at 8:47 PM, mLipok said:

 

Try to use TIDY.

It shows you that you do not close 

Func _Examples_For_Lelikkeo()
....
....
....
....
EndFunc ; <<<< this is missing in your modyfication

Thanks for the tip! the function was closed, but that's not enough, nothing is created and there is no error.

Posted (edited)

I found two my mistakes:

$oQP.SetPageSizes('A3 Landscape')
$oQP.SetPageSizes('A4')

it should be

$oQP.SetPageSize('A3 Landscape')
$oQP.SetPageSize('A4')


and now:

try to change this:

$oQP.SaveToFile(@ScriptDir & '\QP_Lelikkeo_Exmaple.pdf');

to this:

Local $iSavRetValue = $oQP.SaveToFile(@ScriptDir & '\QP_Lelikkeo_Exmaple.pdf');
Local $sErrorMsg = $iSavRetValue & @CRLF & _QPDF_LastErrorCode_Lite($oQP) & @CRLF & '@error = ' & @error & @CRLF & '@extended = ' & @extended
ClipPut($sErrorMsg)
MsgBox($MB_SYSTEMMODAL, 'LastErrorCode', $sErrorMsg)

after this say what you get in MsgBox

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 4/23/2015 at 9:16 PM, mLipok said:

I found two my mistakes:

$oQP.SetPageSizes('A3 Landscape')
$oQP.SetPageSizes('A4')

it should be

$oQP.SetPageSize('A3 Landscape')
$oQP.SetPageSize('A4')


and now:

try to change this:

$oQP.SaveToFile(@ScriptDir & '\QP_Lelikkeo_Exmaple.pdf');

to this:

Local $iSavRetValue = $oQP.SaveToFile(@ScriptDir & '\QP_Lelikkeo_Exmaple.pdf');
Local $sErrorMsg = $iSavRetValue & @CRLF & _QPDF_LastErrorCode_Lite($oQP) & @CRLF & '@error = ' & @error & @CRLF & '@extended = ' & @extended
ClipPut($sErrorMsg)
MsgBox($MB_SYSTEMMODAL, 'LastErrorCode', $sErrorMsg)

after this say what you get in MsgBox

LastErrorCode:

0

 

@error  = 0

@extended = 0

 

 

the error message I got when I removed the function "If-Then-EndIf"

Posted (edited)
  On 4/24/2015 at 4:21 PM, Lelikkeo said:

The error message I got when I removed the function "If-Then-EndIf"

​If you mean this:

If _QPDF_CreateObjectAndUnlock($oQP) = 2 Then

Then it means, the object was not created 

Func _QPDF_CreateObjectAndUnlock(ByRef $oQP)
    _QPDF_CreateObject($oQP)
    If @error Then
        Return -1
    Else

 

but this:

Func _QPDF_StartUp()
    If $__hDll_QPDF = 0 Then
        Local $sDLLFile
        If $__sLicenseKey_QPDF = '' Then ; use Lite version
            $sDLLFile = $__sDebenuPDFLibraryLite_FileFullPath
        Else
            $sDLLFile = $__sDebenuPDFLibraryAX_FileFullPath
        EndIf

        If FileExists($sDLLFile) Then
            $__hDll_QPDF = DllOpen($sDLLFile)
            If $__hDll_QPDF = -1 Then
                MsgBox($MB_SYSTEMMODAL + $MB_OK + $MB_ICONERROR, "DllOpen Error", "Can not open: " & @CRLF & $sDLLFile)
                Return SetError($__eQPDF_ERROR_DLLINIT, 0, -1)
            Else
                Return 0
            EndIf
        Else
            MsgBox($MB_SYSTEMMODAL + $MB_OK + $MB_ICONERROR, "DllOpen Error", "Dll file does not exist: " & @CRLF & $sDLLFile)
            Return SetError($__eQPDF_ERROR_DLLNOTEXIST, 0, 0)
        EndIf
    EndIf
EndFunc   ;==>_QPDF_StartUp

Should show you a MsgBox in case if you do not put DebenuPDFLibraryLite1114.dll in @ScriptDir

 

EDIT:

or

if you use 

_QPDF_SetLicenseKey(...

 

Then maybe you are using wrong/invalid key ??

 

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 4 weeks later...
Posted

Great, I want to know if this udf can check if a pdf file is correct or damaged. I always download pdf file by browser such as firefox. But sometimes, the pdf file can not open. it is damaged because the unstable net speed. Can this udf check if pdf is ok?

Posted

I think it is possible even with Lite version.

Look here:

http://www.debenu.com/products/development/debenu-pdf-library-lite/

You can try to:

  Quote

Load existing PDFs or generate new ones

Set and get document properties (title, author, subject, keyword)

Get page rotation information and rotate pages

Check for fonts, count embedded images, get page width and height

If your PDF is brokent then you get errors from this function , if this PDF is OK you will get the specified information by using above feature.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 5/26/2015 at 4:51 PM, mLipok said:

I think it is possible even with Lite version.

Look here:

http://www.debenu.com/products/development/debenu-pdf-library-lite/

You can try to:

If your PDF is brokent then you get errors from this function , if this PDF is OK you will get the specified information by using above feature.

 

​Yes, I know there is a way to check pdf. Now I only can run foxit and then get the tittle, but by this way, I have to OPEN the pdf, I want to do it in the background. So I search in the internet. I think iText pdf or this  Debenu PDF can do it. But I do not know how to use it in autoit. what is the command? How to use it?

Posted

mLipok, help!

 

I downloaded

QuickPDF.ZIP 

debenu_quick_pdf_library_lite_en.exe

Installed the EXE, copied the DebenuPDFLibraryLite1114.DLL from the program files folder to my working folder.

QuickPDF.au3 gives me $iResultError possibly not declared...

QuickPDF_Examples.au3 gives

   Dll file does not exist: DebenuPDFLibraryLite1012.dll

I searched for "1012" but could not find it...

 

Did I miss something? I have a project where an elegant PDF solution will work wonders, but I cant get this to work.  Am I missing something?

 

 

Skysnake

Why is the snake in the sky?

Posted (edited)

I think you can try to download this version:

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I'am in the process of updating my UDF.

As Debenu add new function to Lite Version, I would like to add new features to my UDF.

  Quote

 

http://www.debenu.com/products/development/debenu-pdf-library-lite/updates/

Release history

Debenu Quick PDF Library Lite 11.14

April 22, 2015

What’s New

 
 

Currently, however, I focus on improving the current version.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

:) downloaded new from the link provided. Works, impressive. Will have a look in the next few days.  Thank you for your rapid response.

 

Skysnake

Why is the snake in the sky?

Posted (edited)

Awesome. 

Is there a recommended sequence for setting up PDFs, or not? Eg At the top, first set PageSize, then Font, origin & measuring units?

I guess it can be done in any order, but is there an optimized approach? faster, more stable?

I will be testing HTML DrawHTMLText later... looking forward to that :)

edit

Hmm, misread that post.  The Debenu library supports the new html... the au3 implementation not yet... So the html test will be only much later...

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Posted
  On 6/2/2015 at 5:45 AM, Skysnake said:

Awesome. 

Is there a recommended sequence for setting up PDFs, or not? Eg At the top, first set PageSize, then Font, origin & measuring units?

I guess it can be done in any order, but is there an optimized approach? faster, more stable?

 

PageSize, then Font, origin & measuring units must be set at "top of page" I mean when you start making first or new page.
In this way you create your customized workplace, and you be know how the parameters are set.

Page setting / parameters should be set by each page, before you make any change on this page.
Font properties you need to set when you want to change font setting for all next drawed text.


You can picture it like this:
First you take the paint (setting font properties), then write (drawing text)
If you want, you change the paint, and then in continuing writing further with new paint.

Btw. you can first make red text in bottom of page and then change color and make new text in top of page.

 

 

  On 6/2/2015 at 5:45 AM, Skysnake said:

I will be testing HTML DrawHTMLText later... looking forward to that :)

edit

Hmm, misread that post.  The Debenu library supports the new html... the au3 implementation not yet... So the html test will be only much later...

You can test it even now.

Just create object and use this methods.

​I just say that I want to make some more complex function "for daily usage" :)

 

 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

May I suggest the next function to get attention is DrawTextBox ?

This will allow multiline text inserts and make writing to a PDF much easier.

HTML is great, but will require a whole set of new developments.  Finalizing all current TEXT options will make for great use!  I cant code C, so the function writing is difficult, but I can test.

Skysnake

Why is the snake in the sky?

Posted
  On 6/2/2015 at 11:37 AM, Skysnake said:

I cant code C, so the function writing is difficult, but I can test.

​Why you talk about C

?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

because the examples are all in Delphi, ActiveX or DLL - which implies knowledge of C to implement... I dont understand the examples provided by Debenu :>

I can only work with the AutoIt code...

Skysnake

Why is the snake in the sky?

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
×
×
  • Create New...