Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #19416
    Oliver Henke
    Customer

    I’m trying to process a csv-file that I created from another file, using a php script. However everytime the export reaches certain rows, it fails throwing the error code 404032. I tried playing around with the file, and when I remove a row that leads to failure, the export runs further until another row causes it to fail.

    So I tried a couple of other things on the first failing row, but I didn’t managed to get it to be processed.
    I’m currently running out of ideas, even reading through the forums didn’t help me much.
    Could that be an encoding issue?

    Thanks in advance.

    #19417
    Pat
    Staff

    Hi Oliver,

    Thanks for getting in touch!

    Common issues when using CSV files that are generated by any kind of programming is that the resulting CSV often does not stay within given conventions.
    The most common issues are:

    • Linebreaks (!), search for “\n” (= Newline) or “\r” (=Carriage return) in your CSV file. A linebreak in a CSV file automatically causes a new record and that record doesn’t have enough cells
    • Missing divider symbols (e.g. comma) so that some cells are simply not existant (but expected to be)

    Could you check for this first?

    Regards
    Pat

    Official MyDataMerge Team

    #19418
    Pat
    Staff

    Add-On:

    While exporting for .csv in PHP, text data should be checked for any linebreaks / new line characters otherwise it will make a mess of your .csv exported file. Apart from checking for usual ‘,’ which will make a new column, you need to check for carriage returns and new line characters and clean the input textual data using following snippet:

    $newlines = array(“\r\n”, “\n”, “\r”);
    $updated = str_replace($newlines,”,strip_tags( stripslashes($input) ));

    If you need to KEEP the linebreaks use this snippet:

    $newlines = array(“\r\n”, “\n”, “\r”);
    $updated = str_replace($newlines,’#LINEBREAK#’,strip_tags( stripslashes($input) ));

    MyDataMerge will replace each occurance of “#LINEBREAK#” with a carriage return after the merge.

    Note: On copying check the quotation marks to be correct in your editor!

    Official MyDataMerge Team

    #19420
    Oliver Henke
    Customer

    Okay, so I tried to clean it up, no luck so far.
    I’ve send in a report, maybe you can have a short look at that.

    I even tried it with a file from 2 years ago, that back then went through the process without issues, and that fails now too.
    I am probably missing something somewhere.

    #19421
    Pat
    Staff

    Hi Oliver,

    thanks for sending in a report.

    The error thrown “under the hood” comes from InDesign. It cannot open a PDF file, so here’s the question to proceed with: Did you set up placing of any PDF file(s) in the merge? MyDataMerge sends in the path, but probably InDesign has an issue with finding it (unfortunately, InDesign doesn’t provide any more information!). This sometimes happens if PDFs are stored in a cloud space (like iCloud), they seem to be existent in the Finder but are not downloaded yet.

    Regards, Pat

    Official MyDataMerge Team

    #19422
    Oliver Henke
    Customer

    Hi Pat,

    The files are stored on a internal server. I took them and put them on my machine, but then realized, that there were some files that were broken, at least some of those did correspond with the lines that broke the export. So I then did replace these files, but still get the same error.

    I’ll send another crash report, but I do suspect that the error still is the same.

    Thanks in advance.

    #19423
    Pat
    Staff

    Hi Oliver,

    YES, the error stays the same. This issue is beyond our scope (it’s not in our business to handle damaged files).

    *** Disclaimer: “Toolboxcode assumes no responsibility or liability for any errors or omissions on the use of the following link. The information contained in this link is provided on an “as is” basis with no guarantees of completeness, accuracy, usefulness or timeliness…” ***

    Here are some approaches of others to identify broken PDFs among hundreds:
    https://superuser.com/questions/580887/check-if-pdf-files-are-corrupted-using-command-line-on-linux

    Official MyDataMerge Team

    #19425
    Oliver Henke
    Customer

    Hi Pat,

    so I just wanted to note that I found even more broken files. I replaced all of them, so now the export finishes.

    Sorry for the confusion, consider this resolved.

    #19426
    Pat
    Staff

    Glad you solved it.

    We added a task to our roadmap to check if its possible to check files before usage if they are corrupted or not.

    Pat

    Official MyDataMerge Team

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘PDF export fails with error code 404032’ is closed to new replies.