Forum

Author Topic: Exported PDF report has black squares instead of text  (Read 6111 times)

ivan-zd

  • Newbie
  • *
  • Posts: 9
    • View Profile
Exported PDF report has black squares instead of text
« on: February 03, 2020, 03:23:05 PM »
When using using Metashape Pyhon API (v 1.6) for PDF report export I get PDF where there are black squares instead of text (titles, ...). Can't figure out why is that happening. I'm running the code on Ubuntu 18.04.

Screenshot is in attachment.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15276
    • View Profile
Re: Exported PDF report has black squares instead of text
« Reply #1 on: February 03, 2020, 06:17:35 PM »
Hello ivan-zd,

Most likely the fonts are not found in the default system location.

I can suggest to set up QT_QPA_FONTDIR environment variable (for example, to  /usr/share/fonts/truetype/dejavu/, if it is location of system fonts on your OS) and check if it helps.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ivan-zd

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Exported PDF report has black squares instead of text
« Reply #2 on: February 04, 2020, 11:53:39 AM »
Hi Alexey,

I've set value for QT_QPA_FONTDIR to the path you defined (it's actually same as on my machine) but it's still the same problem.
Is there any log file where I could maybe check for some warnings etc? I believe there is some missing dependency but not sure where could I look for it.

Maybe somebody else experienced problem like this?

By the way, same thing happens on another machine where we run the script (it's also running with Ubuntu 18.04).

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15276
    • View Profile
Re: Exported PDF report has black squares instead of text
« Reply #3 on: February 05, 2020, 01:20:57 PM »
Hello ivan-zd,

Just to confirm, are you using -r key to start the Python script from the command line or you are using a stand-alone Metashape Python module? If the first option is used, then whether you are using -platform offscreen as additional parameters?
Best regards,
Alexey Pasumansky,
Agisoft LLC

ivan-zd

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Exported PDF report has black squares instead of text
« Reply #4 on: February 07, 2020, 11:43:24 AM »
Hi Alexey,

Yes, I'm using -r key to start the python script and I'm passing also -platform offscreen as additional parameter.

ivan-zd

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Exported PDF report has black squares instead of text
« Reply #5 on: February 07, 2020, 12:01:35 PM »
Ah now it suddenly worked out fine, it might be I just had to restart my machine after updating environment variables, it probably was because of fontdir paths as you first said.
I believe it should be ok from now on, thanks a lot for help! :)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15276
    • View Profile
Re: Exported PDF report has black squares instead of text
« Reply #6 on: February 07, 2020, 02:23:55 PM »
Hello ivan-zd,

Glad that it works now. If the issue re-appear, please let me know.
Best regards,
Alexey Pasumansky,
Agisoft LLC