Comments (11)
This is intentional!
Show me your stack trace.
from pdfcpu.
@hhrutter I got pdfcpu: user font not loaded: Arial
when trying to fill a pdf.
Why is this behaviour of throwing an os.Exit
intentional, I'm using the PDFCPU API instead of CLI hence wouldn't we want to throw errors instead.
from pdfcpu.
Show me your stack trace.
You should have gotten an error way before that!
from pdfcpu.
Bottomline: You have to ensure you have all user fonts installed that you will need for your operation.
I need more info about what you are doing in oder to analyze this.
from pdfcpu.
Even if the API is used in an incompatible way, using os.Exit
in library code is considered bad practice. Better would be to use panic(fmt.Sprintf("pdfcpu: user font not loaded: %s", fontName))
here so it could be catched by the application while still aborting a commandline tool.
from pdfcpu.
This is a judgement call and pdfcpu is still Alpha.
It's more an indication for that you should never ever get into this situation.
Instead of digressing I'd still like to get to the root of this and in order to do so I need more info.
from pdfcpu.
@hhrutter There wasn't any other error before the os.Exit
.
from pdfcpu.
I need to see what you are doing in order to follow up.
from pdfcpu.
@hhrutter I'm using the pdfcpu api's fill function on pdfs which are fetched from s3. I got the above os.Exit message when trying to perform fill action on a pdf. Following is my model configuration
modelConfig := model.NewDefaultConfiguration()
modelConfig.Reader15 = true
modelConfig.WriteXRefStream = true
modelConfig.NeedAppearances = true
Also before filling, I'm performing the optimise action on the pdfs as well.
from pdfcpu.
There should have been a check if the font in question is installed as one of your pdfcpu user fonts prior to os.exiting.
In order to track that down I need to see a full stacktrace please.
from pdfcpu.
@hhrutter Are you talking about checks in pdfcpu or checks that I should implement. I've verified the error log and post downloading the file from s3 the only log that I can see is pdfcpu: user font not loaded: Arial%
from pdfcpu.
Related Issues (20)
- About the version of xRefTable HOT 3
- US Letter has incorrect size HOT 2
- `pdfcpu images list` command can not get output HOT 1
- Api: merge pdf error HOT 2
- import images default command and help info mistake HOT 2
- xRefTable failed: pdfcpu: can't find last xref section HOT 10
- runtime error: index out of range [0] with length 0 HOT 12
- pdfcpu info does not show author attribute
- Invalid reference in stream "Length" causes endless parsing
- Disable centered content when resize page. HOT 1
- Dereference error with a particular (corrupt?) PDF HOT 1
- api: Form fill fails with forms produced with Adobe Acrobat HOT 5
- Bookmark export does not list/export single first-level bookmark HOT 3
- api.PageCount Fails on PDF/A Compliant PDFs HOT 2
- Transparency level when using API HOT 1
- addPageWatermark: ctx.PageDict(pageNr, consolidateRes) returns no error, but nil dictionary HOT 1
- Stack overflow when optimize pdf using API HOT 3
- CLI: Add recursive functionality to the validate feature HOT 1
- CLI: Add an option to only list files that failed validation HOT 1
- support for windows 7 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 pdfcpu.