Did you see Andreas' answer?

Check if the file "Identity-H" is part of your project.

If you're building from source, then you need to build like we build, and this uses maven.

Tilman

Am 26.03.2021 um 17:47 schrieb Jack London:
Hi!

I didn't modify the code only to bypass parameters, so it is reading the
files.

I need the sources because I will modify it once it works. For now the code
I compile is only reading PDF and generating an image of the PDF, creating
PDF with graphics only or with already embedded fonts(like Helvetica). It
reads the Truetype file, but it can't embedded it because it cannot create
a cmap (with getExternalCMap(name)) for name = "Identity-H".

This can't be anything with my system because I am running the application
through Eclipse. I don't create a jar and I don't execute it with line
commands. I do it directly inside Eclipse. So, it can't be the system. I
don't need maven because I am using Eclipse. Perhaps there is a special
order to compile things. Do you think? I find that strange.

Also I compiled CreatePDFATest, but it doesn't have a main. I don't know
how to use Junit. Anyway, I examined CreatePDFATest, and CreatePDFA crashes
much earlier, at line 91:

PDFont font = PDType0Font.load(doc, new File(fontfile));

So the test won't help here.

Cheers.

Jack

On Fri, Mar 26, 2021 at 12:05 PM Tilman Hausherr <[email protected]>
wrote:

Hi,

I tried both and they work. You don't need BC unless you're encrypting.
Commons-log is needed.
Did you use the code "as is" (loading from file) or did you use the font
as a class resource? (There's the resource filtering mistake)

You don't need the sources, you need the pdfbox and fontbox jar files
(use maven if possible), and of course the example source that you're
using. I mentioned the test because it means that it's working at build
time. I'll create a test for two of the HelloWorld tests too.

To see if your system is ok, download pdfbox-app and then run this on
the command line


        java -jar pdfbox-app-2.0.23.jar TextToPDF -ttf fontfile.ttf
yourtext.txt yourpdf.pdf


and see what happens.

Tilman






---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to