Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support maxguru

    (@maxguru)

    Jan,

    I appreciate you letting me know about the issues that you have been having. It would help me debug and resolve these issues if provide more details.

    If you say that editable fields are no longer recognized, it may be because of image optimization plugin. Some of these plugins strip forms from Media Library PDF files. If you have such a plugin installed, I would recommend configuring it to prevent ‘optimizing’ PDF files.

    If an attached PDF is suddenly removed from your form, that may be a symptom of a bigger issue. Do you see any JS console errors when this happens? Maybe your PDF file is deleted by another plugin on the server?

    I need additional information in order to resolve these issues. Would you share a list of your active plugins?

    Thank you.

    Plugin Support maxguru

    (@maxguru)

    Hi Jan.

    When you say “PDF creation fails”, what exactly do you mean?

    The warning is there to let you know that the plugin version 1.3.2 is not verified to work with WPForms version 1.10.0.2. It might still work but there is a chance that the new WPForms version has major changes that break some features of PDF Forms Filler. I would recommend you downgrade WPForms (possibly using WP Rollback plugin) until a new version of PDF Forms Filler is released that has support for WPForms version 1.10+, which will happen soon.

    Please let me know exactly what has been happening since mid January.

    Thank you.

    Plugin Support maxguru

    (@maxguru)

    No. Please use https://maximum.software/support/ for any Pdf.Ninja API related questions.

    Plugin Support maxguru

    (@maxguru)

    There is no concept of mapping “fields” in PDF Forms Filler for WooCommerce like there is in the other PDF Forms Filler plugin variants. There is only the concept of placeholders and the ability to map a text mixed with one or more placeholders to a PDF field. This means that all placeholder values have to be converted to strings and concatenated together into a single string (even if there is only one placeholder in your mapping).

    Unfortunately, as of today, the documentation on the PDF Forms Filler website is still missing the WooCommerce section. I have plans to add it in the future.

    If the plugin allowed multiple lines in value mappings, then you could have mapped text\nillustration value to “Yes” for both PDF fields, however, the plugin doesn’t allow multiple lines in value mappings, so, you can’t use this method.

    What you can do is exactly what you are suggesting, split the checkboxes into separate meta data keys. So, you might have nsv_our_work_type_text and nsv_our_work_type_illustration meta data keys and map {order_item_meta:nsv_our_work_type_text} and {order_item_meta:nsv_our_work_type_illustration} placeholders to their respective PDF fields. For multiple choice PDF fields, you can map both placeholders separated by a new line character (in the mapping text area) to the multiple choice PDF field.

    Let me get back to you regarding improving how the plugin handles placeholders with multiple values. I will think about your use case and see if I can come up with a redesign.

    Plugin Support maxguru

    (@maxguru)

    Regarding the checkboxes, it wouldn’t work with your settings.

    In order for your “check1” and “check2” checkboxes to be filled, the mapped value must equal to the export value of the checkboxes, which in your case is “Yes”. You have value mappings for converting “text” and “illustration” to “Yes”, however, that’s not going to work because the placeholder value is actually “Text\nIllustration”, which doesn’t match “text” nor “illustration”. If I refactored the plugin such that we didn’t need to use implode then maybe it could be made to work with “text” and “illustration” value mappings.

    Your usage is rather strange. Why do you need to set it up like this with a hard-coded placeholder value? Could you not just put the value directly into the placeholder text area without needing to use the {order_item_meta:nsv_our_work_type} placeholder? Please provide more details about your use case.

    Plugin Support maxguru

    (@maxguru)

    Your use of foreach seems incorrect.

    In the current version of the PDF Forms Filler for WooCommerce plugin, placeholder output is turned into an array (for filling multiple choice PDF fields) by splitting on newline characters. However, your code is storing an array as the value of order item meta nsv_our_work_type, which gets turned into the string [Text, Illustration]. The reason why this happens is that the plugin needs a string representation of the array value to be inserted inside another string (text in the mapped text area). So, the string representation [Text, Illustration] is not going to get split correctly for the multi-select PDF field. What we need is to use implode( "\n", $array ) to store a string with multiple lines, each containing a multiple choice field value, instead of storing an array in order item metadata record.

    Below is the code that will currently work for you.


    function nsv_cpt_wc_order_line_item( $item, $cart_item_key, $values, $order ) {
    $array = [ 'Text', 'Illustration' ];
    $item->update_meta_data( 'nsv_our_work_type', implode( "\n", $array ) );
    }

    add_action(
    'woocommerce_checkout_create_order_line_item',
    'nsv_cpt_wc_order_line_item',
    10,
    4
    );

    Let me think about how to refactor array value handling in the plugin such that we can make it work with multiple choice PDF fields without having to use implode. Meanwhile, try the code above and let me know how it goes.

    Plugin Support maxguru

    (@maxguru)

    What you can do is add the following CSS code to the “Additional CSS” input box in your theme’s settings:

    /* Global style for the PDF download box */
    .wpcf7 .wpcf7-pdf-forms-response-output {
    background: #fffbe6; /* change to your color */
    border: 1px solid #f59e0b; /* change to your color */
    color: #1f2937; /* text color */
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin: 1rem 0;
    }

    /* Optional: style the link(s) inside the box */
    .wpcf7 .wpcf7-pdf-forms-response-output a {
    text-decoration: none;
    font-weight: 600;
    }

    Change properties as needed.

    Plugin Support maxguru

    (@maxguru)

    What kind of customization are looking to do?

    There is a lot that can be done with CSS.

    The download box code is in the js/frontend.js file (in the plugin directory). Perhaps it can be changed to do what you need, however, one issue is that any changes there will be overwritten by updates. You may be able to hide the original download box with CSS and add your custom version by making your own frontend.js file.

    Plugin Support maxguru

    (@maxguru)

    I’ve released a new version with a fix. Please try it out and see if it fixes the issue for you.

    Plugin Support maxguru

    (@maxguru)

    This seems to be an issue with the plugin. I think it can be fixed rather easily. Give me a little bit of time to release a new version with a fix.

    Plugin Support maxguru

    (@maxguru)

    Your PDF may have been ‘optimized’ (forms were removed) by one of the optimization plugins. Can you send a list of your currently active plugins?

    If you do have one of those plugins installed, sometimes you can disable PDF optimization in their settings.

    If you don’t have any optimization plugins installed then we may have to look into this further.

    Plugin Support maxguru

    (@maxguru)

    The flattening option does exist. It is not enabled by default. So, it is possible to not flatten the PDF form. However, if you have an XFA form PDF file with no AcroForm fields then flattening is forced. This is happening because of limitations of the SDK being used.

    Plugin Support maxguru

    (@maxguru)

    The “flatten” option is in the PDF attachment options list which can be accessed by pressing the “options” button next to the PDF attachment filename name. See screenshot below:

    Plugin Support maxguru

    (@maxguru)

    Use the ‘flatten’ option.

Viewing 14 replies - 1 through 14 (of 14 total)