Hi folks,

I'm replying to this old thread, adding a bit more info for anyone
searching for this on Google (hopefully the mailing list archive will
add this post to the existing thread...).

> Ok, in dconf you will want to look for
> /org/gnucash/general/report/pdf-export/(filename-format and filename-
> date-format)

I've found these dconf values and changing them works (gnucash 2.6.15).

However, I wanted to use just the invoice number as the filename, so I
changed the value from the default "%1$s-%2$s-%3$s" to "%2$s". Clicking
PDF export on an invoice then crashed Gnucash, with an assertion
failure: *** invalid %N$ use detected ***

This is because printf does not support skipping arguments (when there
is no format string for an argument, printf has no idea how big it is on
the stack, so it cannot tell where the next argument begins).

In this case, I found a simple workaround in the "precision" specifier
of printf format strings. For string arguments, the precision is used as
the maximum string width, truncating any longer strings. So you can add
a zero-width specifier for any arguments that you want to skip. E.g. it
works with "%1$.0s%2$s" (note that argument 3 can be left out, since it
is at the end).

Just in case anyone else runs into this :-)

Gr.

Matthijs

Attachment: signature.asc
Description: PGP signature

_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to