CodeExchange

Appeon Community. PowerBuilder - Appeon Community
  1. The examples uploaded to the site are both compiled for .Net Standard 2.0. I believe that means .Net Framework 4.7.1.

    The most recent version of the library I'm wrapping is .Net 6, so if you wanted to upgrade the component you would need to move to that.
  2. Today I would like to share a small example that I made to be able to fill out Form 145 for my company's employees automatically.
    (This model is used in Spain to declare family and personal data to the company to calculate personal income tax withholding on the payroll, that is, taxes)

    Every year our advisor sends us this form so that we can give it to the employees and they can return it to us completed. To speed up this process, I decided to implement a method that would automate the filling out of the data, generating a personalized PDF for each employee.

    The solution we present today is a simplified version of this process. Basically, it consists of a WebBrowser control that allows you to view the PDF of the form and two buttons that make it easier to obtain and write the fields.

    The first button, called "Get Form Fields", has the function of detecting the fillable fields of the PDF. Clicking on it will display a Messagebox with the name of all identified fields. Additionally, to facilitate programming in the next button, this button copies a code snippet to the clipboard containing the names of the identified fields and the variables associated with their data as follows:

    ls_FormFields[1] = "genter_nif"
    ls_FormData[1] = ""

    ls_FormFields[2] = "genter_compuesto"
    ls_FormData[2] = ""

    ls_FormFields[3] = "genter_anyo_nacimiento"
    ls_FormData[3] = ""
    ...

    This simplifies the process of manually filling out the fields programmatically.

    The second button, called "Fill Form Fields", allows you to automate the process of filling out the fields. In the example provided, this button is programmed to complete the attached form "Modelo145.pdf", but you can easily modify the example to fill out any other form supported by the first button.

    I want to emphasize that the attached form "Modelo145.pdf" is not an official template with fillable fields, but that I have created them personally with the names that I found convenient. However, this adaptation has been very useful to speed up work in my company. Remember that this example is just a simplified sample to illustrate the process of automating PDF form filling. If you decide to use it for your own forms, be sure to adjust the field names and associated data accordingly.

    By the way, the .Net library that I used to create this example is iTextSharp(5.5.13.3) and I have compiled it in .Net6, I have tried to do the same with iText7 but without success, it gives me a strange error when using the library from PowerBuilder as with the digital signature example. Let's see if someone is encouraged and tries to solve it....

    As always, I leave you the current project link on GitHub:

    github.com/rasanfe/pbPdfFillFormFields

    And project in Visual Studio 2022:

    github.com/rasanfe/PdfFillFormFields

    Attached here is the project compiled today in PowerBuilder 2022R3 Build 3356 along with the Visual Studio Project.

    I always recommend going to the github links to find the latest version.

    To be aware of what I publish you can follow my blog in Spanish:

    rsrsystem.blogspot.com
  3. Attached is the sample code demoed in the video: Adding a QR Code Library into your PowerBuilder Application.
    Here is the link for the video:
  4. Thanks Bruce
    I since found the below url that appears to work
    api.qrserver.com/v1/create-qr-code

    And was able to just replace the google api with it. ie

    ls_chart_url = ' api.qrserver.com/v1/create-qr-code/?size= ' + String ( width ) + 'x' + String ( height ) + '&data=' + ls_provision_url

    We may use this as a quick interim solution until we look at integrating your QR dll.

    Kind regards
    Rob
  5. The Dw2Doc App demonstrates techniques to enhance PowerBuilder using third-party components (via Calling .NET Assembly) to export DataWindow to Excel or Word. It is developed with Appeon PowerBuilder 2022 R3.

    Github Source Code: github.com/Appeon/PowerBuilder-Dw2Doc-Example