Hello, could you please help me to solve this problem?
groupdocs-viewer version: 24.8
Java version: 21
pull GitHub - groupdocs-viewer/GroupDocs.Viewer-for-Java: GroupDocs.Viewer for Java examples, plugins and showcase and change the RenderDocumentWithNotes class as following:
package com.groupdocs.viewer.examples.advanced_usage.rendering.common_rendering_options;
import com.groupdocs.viewer.Viewer;
import com.groupdocs.viewer.examples.TestFiles;
import com.groupdocs.viewer.examples.Utils;
import com.groupdocs.viewer.options.HtmlViewOptions;
import com.groupdocs.viewer.options.PngViewOptions;
import java.nio.file.Path;
public class RenderDocumentWithNotes {
/**
* This example demonstrates how to render presentation with notes.
*/
public static void run() {
Path outputDirectory = Utils.getOutputDirectoryPath("RenderDocumentWithNotes");
Path pageFilePathFormat = outputDirectory.resolve("page_{0}.html");
// HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(pageFilePathFormat);
// viewOptions.setRenderNotes(true);
PngViewOptions viewOptions = new PngViewOptions(pageFilePathFormat);
viewOptions.setMaxWidth(1024);
try (Viewer viewer = new Viewer(TestFiles.PPTX_WITH_NOTES)) {
viewer.view(viewOptions);
}
System.out.println(
"\nSource document rendered successfully.\nCheck output in " + outputDirectory);
}
}
package com.groupdocs.viewer.examples;
import com.groupdocs.viewer.examples.advanced_usage.rendering.common_rendering_options.RenderDocumentWithNotes;
import java.io.IOException;
public class RunExamples {
/**
* The main method.
*/
public static void main(String[] args) throws IOException {
System.out.println("Uncomment the example(s) that you want to run in RunExamples.java file.");
System.out.println("=======================================================================");
Utils.cleanOutputDirectory();
RenderDocumentWithNotes.run();
// endregion
System.out.println();
System.out.println("All done.");
}
}
Run the above will get following error:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.groupdocs.viewer.internal.c.a.ms.System.Drawing.Bitmap.getWidth()" because "<parameter1>" is null
at com.groupdocs.viewer.common.e.a(Unknown Source)
at com.groupdocs.viewer.domain.documents.b.b.b.b(Unknown Source)
at com.groupdocs.viewer.domain.documents.b.b.a.b(Unknown Source)
at com.groupdocs.viewer.domain.documents.b.e.a(Unknown Source)
at com.groupdocs.viewer.domain.d.e.closePageStream(Unknown Source)
at com.groupdocs.viewer.domain.documents.converting.a.a(Unknown Source)
at com.groupdocs.viewer.domain.documents.b.e.a(Unknown Source)
at com.groupdocs.viewer.domain.e.b.a(Unknown Source)
at com.groupdocs.viewer.domain.e.b.a(Unknown Source)
at com.groupdocs.viewer.domain.e.b.a(Unknown Source)
at com.groupdocs.viewer.Viewer.view(Unknown Source)
at com.groupdocs.viewer.examples.advanced_usage.rendering.common_rendering_options.RenderDocumentWithNotes.run(RenderDocumentWithNotes.java:27)
at com.groupdocs.viewer.examples.RunExamples.main(RunExamples.java:63)
thanks & Regards
Aray