Hello,
Hi Marcin,
notice the same problem. For the sake of correction, I have logged this problem
as PDFNEWNET-39333 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.
I suppose that it may be a way around - merging many pages into one probably would solve splitted tables problem., but I’m not sure about it.
Hi Marcin,
Hi Marcin,
Document doc = new
Document(“c:/pdftest/InformacjeOZastepstwach.pdf”);<o:p></o:p>
// tune conversion params
HtmlSaveOptions newOptions = new HtmlSaveOptions();
newOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;
newOptions.LettersPositioningMethod = HtmlSaveOptions.LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
newOptions.SplitIntoPages = false;// force write HTMLs of all pages into one output document
newOptions.CustomHtmlSavingStrategy = new HtmlSaveOptions.HtmlPageMarkupSavingStrategy(SavingToStream);
//we can use some non-existing puth as result file name - all real saving will be done
SaveOptions.BorderPartStyle borderStyle= new SaveOptions.BorderPartStyle();
borderStyle.LineType= SaveOptions.HtmlBorderLineType.Dotted;
borderStyle.Color= System.Drawing.Color.Blue;
newOptions.PageBorderIfAny = new SaveOptions.BorderInfo(borderStyle);
//in our custom method SavingToStream() (it's follows this one)
string outHtmlFile = @"c:\pdftest\Final_SomeUnexistingFile.html";
doc.Save(outHtmlFile, newOptions);
private static void SavingToStream(HtmlSaveOptions.HtmlPageMarkupSavingInfo htmlSavingInfo)
{
byte[] resultHtmlAsBytes = new byte[htmlSavingInfo.ContentStream.Length];
htmlSavingInfo.ContentStream.Read(resultHtmlAsBytes, 0, resultHtmlAsBytes.Length);
// here You can use any writable stream, file stream is taken just as example
string fileName = "c:/pdftest/stream_out.html";
Stream outStream = File.OpenWrite(fileName);
outStream.Write(resultHtmlAsBytes, 0, resultHtmlAsBytes.Length);
}
In such case we can see borders of original pages shown in result HTML. Please look at attached screenshot. We can see that tables split because they are put too far from the edge in original PDF.
So, the reason of this situation is : lines ant texts that depicts tables are put too far from edges in original PDF. To correct the situation and enforce tables to be visually "glued" in result, it's necessary to correct original PDF.
We are sorry for the inconvenience caused.
Best Regards,