For every customer, I have the "customer_id", which is a string of 5-7 characters.
When creating the document, I need to dynamically insert a special PDF for each customer.
The name of the PDF is a fixed Path (e.g. "C:/pdf/") plus the customer number formatted as a 8-digit value, padded with "0"s.
Example: customer number "12345" leads the the PDF "C:/pdf/00012345.pdf" - thus this path needs to be set as the "src"-attribute of an image (I guess...)
There are two "challenges":
1) how do I format the number?
I tried to a JavaScript - file that implements a "sprintf" and "vsprintf"-function, but I can not call then; they are unknown. Next try was something like substr() - as there was no change for the image, I can not tell if that one worked as expected.
2) how do I set the attribute?
I tried with a fixed full path (to see if that would work), but no change for the image.
results.attr('src', "C:/pdf/00012345.pdf")
So: how can I generate the correct name for the PDF and apply this name to the image?
Is there any support for debugging the JavaScript-code? Unfortunately, I even didn't manage to display a simple alert() to see the values of my varaibles.
For every customer, I have the "customer_id", which is a string of 5-7 characters.When creating the document, I need to dynamically insert a special PDF for each customer.The name of the PDF is a fixed Path (e.g. "C:/pdf/") plus the customer number formatted as a 8-digit value, padded with "0"s.Example: customer number "12345" leads the the PDF "C:/pdf/00012345.pdf" - thus this path needs to be set as the "src"-attribute of an image (I guess...)There are two "challenges":1) how do I format the number?I tried to a JavaScript - file that implements a "sprintf" and "vsprintf"-function, but I can not call then; they are unknown. Next try was something like substr() - as there was no change for the image, I can not tell if that one worked as expected.2) how do I set the attribute?I tried with a fixed full path (to see if that would work), but no change for the image. results.attr('src', "C:/pdf/00012345.pdf")So: how can I generate the correct name for the PDF and apply this name to the image?Is there any support for debugging the JavaScript-code? Unfortunately, I even didn't manage to display a simple alert() to see the values of my varaibles.
การแปล กรุณารอสักครู่..
