Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentBuilder C++ API: Convert DOCX to PDF failed with V8 error #126

Open
anatoly-spb opened this issue Apr 3, 2024 · 0 comments
Open

Comments

@anatoly-spb
Copy link

anatoly-spb commented Apr 3, 2024

Describe your problem:

I try to convert docx/xlsx file to pdf, but my program finished with:

TypeError: Cannot read property 'length' of undefined
    at Object.a.AscCommon.NU.decode.a.AscCommon.NU.decode (<anonymous>:11662:172)
    at e (<anonymous>:11577:526)
    at n.au (<anonymous>:11597:402)
    at Object.au (<anonymous>:11602:10)
    at e.vGd (<anonymous>:10401:495)
    at e.vGd (<anonymous>:10704:213)
    at <anonymous>:10345:382
    at da (<anonymous>:9653:313)
    at Object.a.AscCommon.aQh (<anonymous>:9835:127)
    at e.yO (<anonymous>:10345:345)

#
# Fatal error in v8::ToLocalChecked
# Empty MaybeLocal.
#

Steps to reproduce the problem:

compile and run C++ program based on your /opt/onlyoffice/documentbuilder/libdoctrenderer.so:

    using namespace NSDoctRenderer;
    CDocBuilder::Initialize(L"/opt/onlyoffice/documentbuilder");
    {
      CDocBuilder oBuilder;
      oBuilder.SetProperty("--work-directory", L"/opt/onlyoffice/documentbuilder");
      oBuilder.CreateFile(L"docx");
      oBuilder.SaveFile(L"pdf", L"my.pdf");
    }

the same error with xlsx:

 using namespace NSDoctRenderer;
 CDocBuilder::Initialize(L"/opt/onlyoffice/documentbuilder");
 {
   CDocBuilder oBuilder;
   oBuilder.SetProperty("--work-directory", L"/opt/onlyoffice/documentbuilder");
   oBuilder.CreateFile(L"xlsx");
   oBuilder.SaveFile(L"pdf", L"my.pdf");
 }

Here is the demo project https://github.com/anatoly-spb/onlyoffice-documentbuilder-cxx-api-demo

DocumentBuilder version:

8.0.0.99

Installation method:

rpm -ivh https://download.onlyoffice.com/install/desktop/docbuilder/linux/onlyoffice-documentbuilder.x86_64.rpm

Operating system:

CentOS 6
g++ (GCC) 11.4.1 20230605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant