Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Sep 18, 2019 10:22 am

At the moment we are changing our Doc(x) to Pdf conversion to use an Azure Function.
So instead of using FileFormat.Pdf we use the ToPdfParameterList in a .NET standard based Azure function.
This works great, except the file size from the Azure converted PDF is much larger then the one saved directly to disk using the PDF format.
The locally created pdf are approx 20kb in size, the azure function converted ones are almost 100kb in size (a factor 5 increase).

Is there a specific reason for this? can this be fixed or influenced?

dinden
 
Posts: 16
Joined: Wed Aug 07, 2019 7:42 am

Thu Sep 19, 2019 10:11 am

Hi,

Thanks for your inquiry.
Did you mean the result Pdf file size generated by the PS method(ToPdfParameterList) was much larger than the result Pdf file size generated by the normal method(FileFormat.Pdf) in azure function project? After an initial test, I didn't reproduce your issue.

To help us investigate your issue accurately, could you please offer us the following information?
1. Your input Word file.
2. The complete code you were using which could reproduce your issue directly.
3. The two output files.
4. The OS and Region information, e.g. Win7 64bit, China/Chinese.

You could upload them here or send us(support@e-iceblue.com) via email.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Thu Sep 19, 2019 12:11 pm

We use the following code.
The difference is only visible when using a net472 project, when using netstandard2.0 (which we use in Azure) both outputs are larger.
We are currently moving from local conversion to Azure based.

Code: Select all
            using (var doc = new Document())
            {
                doc.LoadFromFile("Uitkeringenspecificatie.doc");

                var tpl = new ToPdfParameterList
                {
                    UsePSCoversion = true,
                };


                doc.SaveToFile("Uitkeringenspecificatie_pdf.pdf", FileFormat.PDF);
                doc.SaveToFile("Uitkeringenspecificatie_ps.pdf", tpl);
            }


The in and output files are attached
net472.zip

dinden
 
Posts: 16
Joined: Wed Aug 07, 2019 7:42 am

Thu Sep 19, 2019 12:48 pm

I did some comparisson on the created PDF's, and it seems the PSConversion option embeds the fonts, and the FileFormat.PDF variant does not.
Is it possible to keep the fonts from being embedded?

dinden
 
Posts: 16
Joined: Wed Aug 07, 2019 7:42 am

Fri Sep 20, 2019 10:39 am

Hi,

Thanks for your inquiry.
For .net project, when you use the PS method, the font will be automatically embedded in the result Pdf file while the normal method won't, thus the file generated by PS method is larger than the result file generated by normal method.
For azure function project(.netstandard2.0), the process of the normal method is actually the same as the PS method and the font will be automatically embedded in the result Pdf files, thus the size of the two result files are both large. And sorry that Spire.Doc cannot set the font to be not embedded in .netstandard project at present.
Anyway, I have post your requirement(the font is not embedded in the result Pdf file) to our Dev team. Once there is any progress, we will inform you. Sorry for the inconvenience caused.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.Doc