I am writing a piece of code in VB that converts Excel files that a user uploads into PDF files. It merges all of them into one fixed document and exports that fixed document to a PDF. Whenever I upload specifically the "Schedule" default layout from Google Sheets, exported to xlsx format, all my times are changed from 9:30 AM or 1:28 PM to 9:12 AM and 1:12 PM respectively.
A few key notes that may help with resolving the issue :
Below I have written a snippet of my code, as well as included the xlsx file and the pdf file that results from it. I am using one of the latest versions of Telerik Document Processing, having been downloaded on 6/25/2021.
Using infileStream As Stream = File.OpenRead(inputFilePath) Dim inputFormatter AsNew Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider Dim imported As Spreadsheet.Model.Workbook = inputFormatter.Import(infileStream) imported.ActiveWorksheet.WorksheetPageSetup.PaperType = Model.PaperTypes.Letter imported.ActiveWorksheet.WorksheetPageSetup.CenterHorizontally = True imported.ActiveWorksheet.WorksheetPageSetup.FitToPages = TrueDim format AsNew Spreadsheet.FormatProviders.Pdf.PdfFormatProvider Dim fixedDoc As Fixed.Model.RadFixedDocument = format.ExportToFixedDocument(imported) primaryDoc.Merge(fixedDoc) EndUsing