PDF export blank

We’re evaluating the .net diagram product.

When saving a vsdx object as PDF we get a blank diagram.

I’ve noticed this was reported previously and it doesn’t seem to be resolved. I’m using a flowchart LayoutOptions to get around the awful pagination in vxsdx.

It’s not actually fully blank - the text on the connectors is there but not the connectors or shapes. There is a Process shape with some text in it that contains the text but is not visible. The original vsdx saves fine as a PDF in Visio.

@stevebrettyw

Could you kindly share your sample Diagram with us so that we can test the scenario in our environment and address it accordingly.

@stevebrettyw

As requested earlier, please share source Diagram (.vsdx/.vsd) in .zip format with us so that we can test it in our environment and address the issue accordingly.

aspose test.zip (36.3 KB)

Ok attached.

@stevebrettyw

Would you kindly make sure that you are using a valid or 30-days free temporary license during evaluation of the API? We tested the scenario in our environment using Aspose.Diagram for .NET 20.8 and were unable to notice any issue. For your kind reference, an output PDF is also attached. Please let us know in case you notice any issue in the attached file.

Test.pdf (78.7 KB)

I am using a valid 30 days license.

One difference might be that I am creating the Visio document and then creating a stream to download ? I’m not saving the file then opening and converting.

using (var stream = new MemoryStream())
            {
                if(saveFormat == SaveFileFormat.VSDX)
                {
                    Aspose.Diagram.Saving.DiagramSaveOptions saveOptions = new Aspose.Diagram.Saving.DiagramSaveOptions()
                    {
                        SaveFormat = SaveFileFormat.VSDX,
                        AutoFitPageToDrawingContent = true
                    };
                    diagram.Save(stream, saveOptions);
                }
                if(saveFormat == SaveFileFormat.PDF)
                {
                    Aspose.Diagram.Saving.PdfSaveOptions saveOptions = new Aspose.Diagram.Saving.PdfSaveOptions()
                    {
                        SaveFormat = SaveFileFormat.PDF,
                        JpegQuality = 100,
                        PageSize = new Aspose.Diagram.Saving.PageSize(Aspose.Diagram.Saving.PaperSizeFormat.A4),
                        DefaultFont = "Arial",
                        EnlargePage = true,
                        SplitMultiPages = true,
                        Shapes = diagram.Pages[0].Shapes
                };
                    diagram.Save(stream, saveFormat);
                }
                
                var content = stream.ToArray();
                return File(content, contentType, String.Format("{0}.{1}", trace.Name, saveFormat.ToString()));
            }

Content type for PDF would be

“application/pdf”

@stevebrettyw

You may please try saving the generated diagram into memory stream and reloading it into Diagram object to convert into PDF. Furthermore, we request you to please share complete sample code snippet which includes steps to generate the diagram that you are generating. Also, please share sample stencil file for our reference so that the scenario can be tested and addressed accordingly.

So you want me to create the document, write it to a stream, then reload from a stream as a pdf, then write it to a stream again so I can download it ?

I’ve attached the class that generates the Visio and the stencil as requested - instead of reading the data just loop and create 40 empty shapes. visio stuff.zip (32.2 KB)

@stevebrettyw

We do realize that it will increase time and memory cost. We only suggested it as a workaround. Nevertheless, we are now testing the scenario with your provided code and sample stencil file and will get back to in a while.

Saving the vsdx to a stream, then loading that stream into a new document and then saving stream using PDF options didn’t work.

I’ve also noticed that some of the colours in the vxdx are not showing, in my example code you’ll see some code that switched the colour to red if the duration is greater than the threshold - this no longer works at all - to be honest it was patchy before but we have bigger issues with the PDF failing.

@stevebrettyw

We have logged an issue as DIAGRAMNET-51935 in our issue tracking system for the sake of further investigation against this scenario. We will further look into its details and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

We apologize for the inconvenience caused.

Can we escalate this issue ? We now have a full license and we have the same problem with the PDF output.

The colours issue seems to have gone away now as soon as I applied the new license file.

@stevebrettyw

We would like to share with you that investigation against earlier logged-ticket is underway. However, we tried to execute the code snippet shared by you and noticed that some namespaces or .dll were missing. Would you kindly provide a sample project in .zip format which can run without error and replicate the issue. It would help us during investigation and resolving the issue accordingly.

We apologize for the inconvenience faced.

Hi - just extract the routine that generates the Visio and loop 30 times adding new shapes. The code is data driven and there is nothing in there that can’t be easily mocked.

@stevebrettyw

Thanks for your feedback.

We will let you know in case of further updates.

@stevebrettyw

Would you please try to set lines color or chars color like this:

string textBoxColour = "RGB";
textBox.Line.LineColor.Value = "#606060";

In case you still face any issue, please let us know.

that seems to have fixed the colour issue -thanks - just the PDF issue to resolve now :slight_smile:

@stevebrettyw

Thanks for your feedback.

We have used the attached code to test the scenario. Would you kindly use it and see if PDF related issue still occurs. You may please change it as per your needs and share it back if issue persists with your changes.
51935.zip (1.5 KB)

Hi - this seems to have fixed it - the only change I could see was that then line colour now uses the RGB value and not the formula set. Thanks for the change but the PDF output is not paginated and only prints the first page cutting off the rest of the diagram - good to get some output but it’s not usable.

@stevebrettyw

Thanks for sharing your feedback.

We have updated the ticket information accordingly and will let you know as soon as we have further updates.