Free Support Forum - groupdocs.com

GroupDocs.Viewer.Examples.CSharp example 's RenderDocumentAsPDF Example Paging problem


#1

Hi,

I’m using example call RenderDocumentAsPDF , input excel file(has 3 pages),
but the pdf file only 1 page ???
May I have 3 pages also?

#2

Hello Jenny,


Many thanks for your query,

The Examples at github.com have been carefully written and tested.

Please make sure that you didn’t change the code of any function. If you had made any change then please provide us the written code.

Make sure that the file which have been used is in proper format.

Can you provide us the problematic PDF so we could reproduce the issue at our end?


Thanks in Advance



#3

The issues you have found earlier (filed as VIEWERNET-436) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by groupdocs.notifier.

#4

Hi Muhammadumar,

My code are below,

//license …
GroupDocs.Viewer.License lic = new License();
lic.SetLicense(@“d:\GroupDocs.Viewer.lic”);
//gen PDF file
RenderDocumentAsPDF(@“D:\e3.xls”);

//
public static void RenderDocumentAsPDF(string fullFileName)
{
var fileName = Path.GetFileName(fullFileName);
var pdfName = Path.GetFileNameWithoutExtension(fullFileName) + “.pdf”;
var storageFolder = Path.GetDirectoryName(fullFileName);

var config = new ViewerConfig();
config.StoragePath = storageFolder;
config.UseCache = false;

var imageHandler = new ViewerImageHandler(config);

var options = new PdfFileOptions();
//file name
options.Guid = fileName;

//gen PDF
FileContainer container = imageHandler.GetPdfFile(options);

using (FileStream fileStream = File.Create(Path.Combine(config.StoragePath, pdfName), (int)container.Stream.Length))
{
byte[] bytesInStream = new byte[container.Stream.Length];
container.Stream.Read(bytesInStream, 0, bytesInStream.Length);
fileStream.Write(bytesInStream, 0, bytesInStream.Length);
}
}

Attach File toPDF.zip contains e3.xls , e3.pdf (use ViewerImageHandler to render file), e3_ms.pdf (use office excel save as pdf)

Thanks.


#5

Hello Jenny,


Thank you for raising the issue as you mentioned in your earlier post.

I am logging an improvement request in our Issue Tracking System. Our product team will look into this feature. Once there is any further update, you will be updated via this forum thread.

Thanks in advance



#6

Hi Muhammadumar,

Other problem is there are more space at right side in pdf file.
Do I have to change other settings? Thank you.


Best Regards,
Jenny.

#7

Hi Jenny,


I am going to include your point into the already raised issue. Our product team will also look at this issue. You would be informed through this thread, as any update would be taken place.

Thank you

#8
Hi Muhammadumar,
Thank you.

Best Regards,
Jenny.

#9

You are always welcome :)