Jump to content

Create PDF from your application


taietel
 Share

Recommended Posts

23 hours ago, Mannyfresh31 said:

_InsertImage() not working after updating to  AutoIt v3.3.14.3

it doesn't give any errors it just doesn't load the image to the PDF file ):

any help would be great

Manny, take a quick look at this.. There might be some functions that are broken that you can fix by just updating the files, the latest update broke a few of my scripts till I realized that this was the issue.

 

Link to comment
Share on other sites

3 minutes ago, BatMan22 said:

Manny, take a quick look at this.. There might be some functions that are broken that you can fix by just updating the files, the latest update broke a few of my scripts till I realized that this was the issue.

 

I looked at that earlier and replaced the File.au3 since the MPDF udf uses it but still not luck ):

I attached a snip of the included files in the MPDF like I said File.au3 is the only one library that that this udf uses of the ones that have been fixed. 

Capture29.JPG

Link to comment
Share on other sites

My problem has been fixed as BatMan22 suggested downloading all 6 files and putting them in the include folder after renaming them fixed my problem I guess is a bug in the files as melba23 says you can look at this other thread where he states that replacing the files not only fixes the include library but some other internal  things thanks to all who tried to help me and to those having problems with your scripts go ahead and download the files.

Link to comment
Share on other sites

  • 3 weeks later...

has there been an update to the mpdf_udf.au3?

i see that the _iif( statements are deprecated in 3.3.14.5 and even if i convert them to the correct inline conditional formats, the result of the example builds do not work.

i have updated to 3.3.14.5

i just get adobe errors saying that the pdf is unreadable.

 

Link to comment
Share on other sites

  • 4 months later...
  • 2 weeks later...
  • 5 months later...

Hi,

create UDF!

I have a question...

I wrote an application, with many items, if i create a PDF from this appliccation, PDF has one site. Everythink is fine.

If i create a another pdf with different name, i get a new pdf file include the first PDF file and the secound. Now i have a PDF with two pages, but ich want only one PDF for each run...

 

best regards

Link to comment
Share on other sites

  • 1 month later...
14 hours ago, LukeLe said:

I have trouble with this statement also when runnign the examples.

Have you tried fixing them? IIF is no longer supported in the release versions of AutoIt, change them to If/ElseIf/Endif statements instead.

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

Link to comment
Share on other sites

an easy fix: just add the following snippet at the bottom of the MPDF_UDF.au3

; by @zedna
; https://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/?do=findComment&comment=1192000

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

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Link to comment
Share on other sites

I have found another bug related to landscape format which does not have any effect - using _SetOrientation($PDF_ORIENTATION_LANDSCAPE).

I have found a quick fix only (not being proud of that) - however, at least it works. I am attaching the v105.

Further I have pretty completely rewritten the text2pdf sample as I needed some features that could not have been solved keeping the old algorithm. And I have added several other options.

Usage of the text2pdf sample:

 text2pdf.exe "<textfile>" "<outputfile>.pdf" "COURIER|ARIAL|TIMES|CALIBRI|GARAMOND" "<fontsize>" ["<title>"] [<options>] ["<extraheader>"]

 <options> ::= <option>{,<option>} ... Comma separated list of option keywords where <option> can be:
 <option> ::= nodate|nopagenr|noheader|noheading|leftheading|repeatfirstline|landscape|openfile|debug|debugfine|debugfiner|debugfinest

Option debug is equivalent with debugfiner.

 Known issue: When using repeatfirstline option together with some font sizes (e.g. 10 or 12) you may experience unregular line spaces.
 Change font size a little in these cases. Use font size 11 or 13 instead for example.

MPDF_UDF.au3 text2pdf.au3

Link to comment
Share on other sites

On 2/28/2019 at 11:03 PM, mwildam said:

I have found another bug related to landscape format which does not have any effect - using _SetOrientation($PDF_ORIENTATION_LANDSCAPE).

 

@mwildam I think twas deliberate.

I haven't looked at your fixes, but to set landscape orientation change the paper size:

If $OPT_ORIENT = $PDF_ORIENTATION_LANDSCAPE Then
        _SetPaperSize("CUSTOM", 841.890, 595.276); A4 landscape
    Else
        _SetPaperSize("A4"); A4 portrait
    EndIf
    _SetOrientation($PDF_ORIENTATION_PORTRAIT) ; even for landscape

 

Link to comment
Share on other sites

Well, I did something similar:

Func _SetOrientation($iOrientation = $PDF_ORIENTATION_PORTRAIT)
    $_Orientation = $iOrientation
    
    If ($_Orientation = $PDF_ORIENTATION_LANDSCAPE) Then
        ;Quick fix by Martin Wildam as otherwise orientation change looks like having no effect
        Local $bku = $_PageWidth
        $_PageWidth = $_PageHeight
        $_PageHeight = $bku
    EndIf
EndFunc   ;==>_SetOrientation

By setting orientation the currently set paper size is switched in Width and Height. It looks like that in PDF you need to set orientation plus correct page size to have the desired effekt. As a programmer I was expecting that when I set paper size to A4 and then set orientation to landscape that should be sufficient. So therefore I changed it this way.

Link to comment
Share on other sites

@mwildam, may I suggest that you make the text2pdf as a separate download?

Obviously it has roots here, but it appears that you have rewritten most of the code and a stand alone text to pdf converter is a very handy and powerful tool to have around 😊

Skysnake

Why is the snake in the sky?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...