Comments (10)
Submitted qpdf 1.3.3 to cran.
from qpdf.
Can you send a pr?
from qpdf.
I think that you are asking for a pull request, which I understand to mean a proposed correction to the code. However, I am not a C++ programmer and could not find the part of the code that creates the filename. I am sorry, but I cannot help with fixing the code.
BTW, Above I proposed computing the exact size needed for the index numbers in the file name. I realized later that a simpler solution might be to always use a 9 digit number. That would accommodate up to 1 billion pages and so would be very unlikely to cause problems for anyone.
from qpdf.
I am not a C++ programmer either, but I'd also appreciate if this could be fixed.
The described behaviour stems from this line:
Line 45 in da5d359
int_to_string
receives pages.size()
as the number of digits of the resulting string, when it should for n
pages receive floor(log10(n))+1
(in R-syntax).
(If I had to fix it, I'd #include <math.h>
in bindings.cpp
and use floor/log from that file. But I perhaps Rcpp offers something better here?)
from qpdf.
Yet another non-C++ programmer but one of my scripts also just choked on the same problem.
The description from Enrico @enricoschumann looks very useful for me but I also don't know enough C++ to turn this into a fix in the code (and ultimately into a PR).
Jeroen @jeroen, is this something you might be able to have a look again in the not so distant future?
from qpdf.
Can you please include example code? It seems to work as intended for me, the filename is postfixed with a number, but not excessive.
> pdf_file
[1] "/var/folders/gz/rwkfg8wx1wqgcr0ccpz42dyc0000gn/T//RtmpZvEBI7/output.pdf"
> pdf_length(pdf_file)
[1] 3
> pdf_split(pdf_file)
[1] "/private/var/folders/gz/rwkfg8wx1wqgcr0ccpz42dyc0000gn/T/RtmpZvEBI7/output_001.pdf"
[2] "/private/var/folders/gz/rwkfg8wx1wqgcr0ccpz42dyc0000gn/T/RtmpZvEBI7/output_002.pdf"
[3] "/private/var/folders/gz/rwkfg8wx1wqgcr0ccpz42dyc0000gn/T/RtmpZvEBI7/output_003.pdf"
from qpdf.
Ah I found the issue. It is fixed now, you can install the new version from https://ropensci.r-universe.dev/qpdf. I'll try to release to CRAN soon.
FWIW, if you had included a reprex code it would have been much easier for me to fix this sooner.
from qpdf.
Fantastic, Jeroen, thanks for resolving this issue - and apologies for not posting a reproducible example.
BTW: I think this also resolves the issue that had prompted PR #6 which can be closed now IMO. Your solution is nicer.
from qpdf.
Fantastic, thanks, already live.
from qpdf.
great, many thanks!
from qpdf.
Related Issues (15)
- Feature Request
- Question: overlaying OCR'd text in package scope?
- Feature Request: pdf_split() function appending too many zeros into file name. HOT 2
- Feature Request: Integration of Pages from Multiple PDFs HOT 1
- Can you add parameters to make the page size uniform using pdf_combine()
- jpeglib.h not found HOT 3
- Bookmarks
- Expose overlay feature HOT 4
- Error: ld: library not found for -ljpeg HOT 13
- WARNING qpdf is needed for checks on size reduction of PDFs
- Error when installing qpdf in Windows 10
- Compatibility with qpdf 11 HOT 4
- Error: too many open files HOT 4
- Remove PDF pages while retaining the bookmarks HOT 2
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 qpdf.