Hi Team,
using Aspose.Pdf for .net 4.7
I am converting pdf to html and then reconverting html back to pdf.
at the time of reconverting html back to pdf …I am setting page size paramerts as original file…but stil I am getting minor difference in page size
these is the code I am using for pdf to html conversion.
HtmlSaveOptions options = new HtmlSaveOptions();
options.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;
options.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
options.LettersPositioningMethod = HtmlSaveOptions.LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
this is the code I am using to regenerate html back to pdf and setting page size.
HtmlLoadOptions objLoadOptions = new HtmlLoadOptions();
objLoadOptions.PageInfo.Height = pdf.Pages[1].Rect.Height;//pdf is object of original pdf file.
objLoadOptions.PageInfo.Width = pdf.Pages[1].Rect.Width;
objLoadOptions.PageInfo.Margin.Bottom = 0;
objLoadOptions.PageInfo.Margin.Top =0;
objLoadOptions.PageInfo.Margin.Right = 0;
objLoadOptions.PageInfo.Margin.Left = 0;
In Regenerated file I am able to see page is pushed inside leaving white border…and all precedding pages are pushed to next page for some minor part.
please find attached original pdf file , html file and regenerated file .
html reg_pdf.zip (6.7 MB)
original_pdf.zip (3.4 MB)
Can you suggest me a way to solve this issue