Comments (3)
Thanks for the feedback - sounds like a difficult environment to port software to :)
Regarding %g, I think making that change might result in scientific notation output (ie: 3.9265e+2), which I don't think is valid for a PDF. I don't think printf has a precision specifier for %f to tell it to strip trailing zeros unfortunately. Without putting our own special formatter in for this, there doesn't seem to be an easy way to get the desired output.
In general the PDFGen output is not super size optimised, it's more about simplicity & readability (although obviously dropping trailing zeros would benefit both of those if it were easy to implement)
from pdfgen.
Thanks Andre. Good point about the possibility of scientific notation in the output. We wouldn't want that in a PDF document. I'm guessing a better solution would be to use a PDF specific formatting routine that could format a floating point number with %f and remove any trailing zeros. I'll have to give that some more thought.
I have to wonder if there will be edge cases in which the use of %g would actually format a float with scientific output for a PDF document. I don't really know, so I have to admit the use of %g would not be the safest thing as different implementations of the standard C library functions could cause it to not work, that is not have scientific notation, in all cases.
Thanks again. I appreciate the feedback. Best Wishes.
--Mike
from pdfgen.
I'll close this for now then, since it doesn't look like %g is going to work in all cases. Let me know if you want to reopen it or have some other thoughts on the matter.
from pdfgen.
Related Issues (20)
- A HOT 1
- Smart quotes and em dash HOT 8
- 我无法使用密码"abc"打开output.pdf HOT 3
- Macos HOT 5
- Unicode Fonts HOT 18
- Minor gcc warning in pdfgen.c HOT 3
- Generated PDF Comes Broken HOT 5
- The pdf_add_text_wrap method does not work for me HOT 4
- Lua binding HOT 1
- Improper Display of °(Degree Symbol) HOT 9
- gcc/g++ warnings HOT 5
- Some improvements HOT 8
- Improvement HOT 3
- Add support for UPC barcodes HOT 3
- Issues with adding png image files to pdf HOT 9
- Add support for clib
- MINGW COMPILATION HOT 7
- Add encryption & protection flags support HOT 1
- Adding an image as the entire page HOT 5
- l can't find data_penguin_jpg[] and data_penguin_jpg_len HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfgen.