Git Product home page Git Product logo

Comments (11)

hhrutter avatar hhrutter commented on September 25, 2024

This is intentional!
Show me your stack trace.

from pdfcpu.

vedantmamgain avatar vedantmamgain commented on September 25, 2024

@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.

hhrutter avatar hhrutter commented on September 25, 2024

Show me your stack trace.
You should have gotten an error way before that!

from pdfcpu.

hhrutter avatar hhrutter commented on September 25, 2024

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.

fancycode avatar fancycode commented on September 25, 2024

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.

hhrutter avatar hhrutter commented on September 25, 2024

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.

vedantmamgain avatar vedantmamgain commented on September 25, 2024

@hhrutter There wasn't any other error before the os.Exit.

from pdfcpu.

hhrutter avatar hhrutter commented on September 25, 2024

I need to see what you are doing in order to follow up.

from pdfcpu.

vedantmamgain avatar vedantmamgain commented on September 25, 2024

@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.

hhrutter avatar hhrutter commented on September 25, 2024

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.

vedantmamgain avatar vedantmamgain commented on September 25, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.