metafloor / bwip-js

Barcode Writer in Pure JavaScript
Other
2.11k stars 304 forks source link

How to show text with latest version bwip-js on html? #10

Closed dtanh72 closed 9 years ago

dtanh72 commented 9 years ago

Dear men,

How are you?

I downloaded the latest version of bwipjs. But i can not show text below the 1D barcodes.

Would you like to show me how to apply the text below the 1D Barcode?

thanks and best regards.

bwippjs

metafloor commented 9 years ago

Are you trying to access the demo from a file:// URL? If so, that is not supported. The emscripten-compiled freetype library uses XHR to request the library's memory image. See the Usage section of the bwip-js home page for more details.

If you are using an http server, please show the bwip-js files being served in the access log.

dtanh72 commented 9 years ago

Yes, i downloaded the latest version of bwipjs at URL: http://metafloor.github.io/bwip-js/. I use server local, I used all means to run the demo, but i can not show text below the 1D barcode. I think that I have downloaded the source code is missing the display text below the 1D barcode.

bwippjs_demo

metafloor commented 9 years ago

Please show the server's access log for the bwip-js files. I suspect the freetype.js.mem file is not being served correctly.

Do you see any console/error messages in Chrome's debugger panel?

dtanh72 commented 9 years ago

Yes, when i debug console occurs error: uncaught initializer memory could not load freetype.js.mem

bwippjs_demo

dtanh72 commented 9 years ago

Please guide me fix this error Thank you very much.

metafloor commented 9 years ago

You are getting a 404 on freetype.js.mem. This means either the file does not exist (unlikely), or is unreadable (check access permissions on the file), or the server does not understand the .mem file extension.

I suspect the .mem file extension is not configured in the http server you are using. You need to set its MIME type to application/octet-stream.

Check the error log for the server and see if it is complaining about an unknown file type. And let me know what type of http server (and OS) you are using. I work with apache and node.js. I may or may not be able to help you with other http servers... It's almost 23:00 my time, so I am off to bed soon.

dtanh72 commented 9 years ago

Thanks again, this is now useful. Regards.

metafloor commented 9 years ago

Leaving this issue open to remind me to document the odd-ball .mem file extension.