We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

PDFLogicDocument and PDFDocument Together?

Thread ID:

Created:

Updated:

Platform:

Replies:

44958 Jun 7,2006 04:25 PM Jun 22,2006 09:55 AM ASP.NET Web Forms (Classic) 13
loading
Tags: PDF
Administrator [Syncfusion]
Asked On June 7, 2006 04:25 PM

Is there a way to add the content of a PDFLogicDocument to a PDFDocument? From the samples, I can see that PDFDocument has more flexibility then the PDFLogicDocument. If that is not possible, is there a way to take the HTMLToDLS convertor.Convert("html string") results and add that to a PDFDocument and not a PDFLogicDocument? Thanks in advance.

Ajish [Syncfusion]
Replied On June 8, 2006 07:07 AM

Hi, Sorry for the inconveniece. It is not possible to use HTMLToDLS convertor along with GridModel[PDFDocument] it can only be used with FlowModel[PDFLogicDocument]. However we do have othere options to convert a webpage,HTMLDocuments and HTML string into PDF using GridModel[PDFDocumnt]. The following is the options available 1) HTMLConvertor can only be used to convert WebPages and HTML pages to PDF it is done with the help of HtmlConverter.Base.dll. The HTMLConverter uses the MSHTML rendering library to render HTML documents. Here is a sample to do this: WebPageToPDF.zip 2) To import HTMLstrings into PDFDocument use Essentail HTMLUI which would convert HTML document/Strings to a image. This image can be easily imported to PDF document. Here is a sample fo your reference: HTMLToDoc.zip Please take a look at the sample and let me know if you any other questions. Thanks, Ajish.

Administrator [Syncfusion]
Replied On June 9, 2006 02:58 PM

Thanks Ajish, The HTMLToDoc.zip is what I am looking for. One question, the height of the created image is not accurate. If I put two created images, one right after the other, it puts a lot of space between the two. The more information I add to the first image does not seem to grow the "image" height in proption it keeps the second image in the same location. Is there something I can do to get a more accurate height of the created image? I am attaching my generated PDFs to show you the image heights. Thanks for the help!

testing1.zip

Administrator [Syncfusion]
Replied On June 9, 2006 04:57 PM

Actually, after running some more tests in Debug mode, I noticed the image height is adjusted but the DrawImage point on the PDF page is not being adjusted correctly. Is there a buffer that the PDF DrawImage puts around the images automatically? Can that be turned off? Bitmap bmpImg2 = CreateBitmap(); PointF point = new PointF(); point.X = 0; point.Y = bmpImg.Height; // Height of first image pdfDoc.LastPage.Graphics.DrawImage(point, bmpImg2, props); >Thanks Ajish, > >The HTMLToDoc.zip is what I am looking for. One question, the height of the created image is not accurate. If I put two created images, one right after the other, it puts a lot of space between the two. The more information I add to the first image does not seem to grow the "image" height in proption it keeps the second image in the same location. Is there something I can do to get a more accurate height of the created image? I am attaching my generated PDFs to show you the image heights. > >Thanks for the help!

testing1.zip

Administrator [Syncfusion]
Replied On June 12, 2006 09:28 AM

Hi, Sorry for the delay in getting back to you. I was able to see the problem. I am investing on this issue I will send you an update regarding this as soon as possible. Thanks, Ajish.

Administrator [Syncfusion]
Replied On June 13, 2006 06:25 PM

Hi I was using the HTMLtoDoc sample file and I was noticing the image was being chopped off. If you see in the attachment DTO.pdf contains all of my section labels however the DTO2.pdf has data in it but it truncates the remaining sections. Here is the code I used to add the image to the pdf: IPDFGraphicState props = pdfDoc.CreateGraphicState(); props.SplitImages = true; Bitmap bmpImg = CreateBitmap(strHTML); pdfDoc.LastPage.Graphics.DrawImage(PointF.Empty, bmpImg, props); Thanks for your help.

PDFs.zip

Ajish [Syncfusion]
Replied On June 15, 2006 08:45 AM

Hi Alex, Sorry for the delay in getting back to you. I was able to see the problem in the PDF files send by you. However I was unable to reproduce the problem with my test sample. Can you please send me your sample to reproduce this issue. So that I can investigate further on this. Thanks, Ajish.

Administrator [Syncfusion]
Replied On June 16, 2006 09:34 AM

Hi Ajish Here is some code that is printing ''Testing'' repeatedly and the last line is getting cut in half. I also created another table which contains ''W''s for text in the HTML string after all of the ''Testing'' paragraphs table and the ''W''s are overlapping with the last ''Testing'' paragraph. Thanks again for your help. Alex

PDF0.zip

Ajish [Syncfusion]
Replied On June 19, 2006 09:51 AM

Hi Alex, Sorry for the delay in getting back to you. I was able to see that the html text is not proper in the given sample. Please note that the HTMLUI control expects clear HTML strings while rendering. The issue in that sample is
tag is placed in-between the tr tag and the table tag like this,
SomeText
I have replaced it like this,
SomeText
Here is the modified sample: HTMLUIToImage.zip Please take a look at the sample and let me know if you have any concerns. Thanks, Ajish.

Administrator [Syncfusion]
Replied On June 19, 2006 02:30 PM

Hi Ajish, Is there any update on the image height and width being generated by the sample and why the placement on the PDF page is not correct? Also, I am noticing the width of the converted HTML image does not cover the width of the page. Can that be controlled? I pass in HTML strings not a full HTML page. Thanks! >Actually, after running some more tests in Debug mode, I noticed the image height is adjusted but the DrawImage point on the PDF page is not being adjusted correctly. Is there a buffer that the PDF DrawImage puts around the images automatically? Can that be turned off? > >Bitmap bmpImg2 = CreateBitmap(); >PointF point = new PointF(); >point.X = 0; >point.Y = bmpImg.Height; // Height of first image > >pdfDoc.LastPage.Graphics.DrawImage(point, bmpImg2, props); >

Ajish [Syncfusion]
Replied On June 20, 2006 01:38 PM

Hi, Sorry for the delay in getting back to you. I will send you an update reagarding this as soon as possible. Thanks, Ajish.

Henry Ko
Replied On June 20, 2006 04:47 PM

Hi Ajish, I tried your HTMLToDoc.zip sample program and was able to generate the PDF file, but the problem is the text quality is not good, looks like it''s printed by the dot-matrix printer using its draft mode. I noticed the sample HTML-Converted PDF documents on Syncfusion''s web site have the same problem too. Is there anything Syncfusion can do to improve the text quality in this case? >Hi, > >Sorry for the inconveniece. It is not possible to use HTMLToDLS convertor along with GridModel[PDFDocument] it can only be used with FlowModel[PDFLogicDocument]. However we do have othere options to convert a webpage,HTMLDocuments and HTML string into PDF using GridModel[PDFDocumnt]. The following is the options available > >1) HTMLConvertor can only be used to convert WebPages and HTML pages to PDF it is done with the help of HtmlConverter.Base.dll. The HTMLConverter uses the MSHTML rendering library to render HTML documents. > >Here is a sample to do this: WebPageToPDF.zip > >2) To import HTMLstrings into PDFDocument use Essentail HTMLUI which would convert HTML document/Strings to a image. This image can be easily imported to PDF document. Here is a sample fo your reference: HTMLToDoc.zip > >Please take a look at the sample and let me know if you any other questions. > >Thanks, >Ajish. > > > > >

Ajish [Syncfusion]
Replied On June 22, 2006 04:47 AM

Hi, Sorry for the delay in getting back to you. Here is a modified sample which creates a image with respect to the pdf document page width. Sample:HTMLToDoc.zip The width of the image can be adjusted using the following code. doc.ClientSize = new Size(width,height); Please take a look and let me know if you have any questions. Thanks, Ajish. >Hi Ajish, > >Is there any update on the image height and width being generated by the sample and why the placement on the PDF page is not correct? Also, I am noticing the width of the converted HTML image does not cover the width of the page. Can that be controlled? I pass in HTML strings not a full HTML page. > >Thanks! > >>Actually, after running some more tests in Debug mode, I noticed the image height is adjusted but the DrawImage point on the PDF page is not being adjusted correctly. Is there a buffer that the PDF DrawImage puts around the images automatically? Can that be turned off? >> >>Bitmap bmpImg2 = CreateBitmap(); >>PointF point = new PointF(); >>point.X = 0; >>point.Y = bmpImg.Height; // Height of first image >> >>pdfDoc.LastPage.Graphics.DrawImage(point, bmpImg2, props); >> >

Administrator [Syncfusion]
Replied On June 22, 2006 09:55 AM

Hi Ajish, I fixed the HTML and it works good now. Thanks a lot for your help. Alex >Hi Alex, > >Sorry for the delay in getting back to you. I was able to see that the html text is not proper in the given sample. Please note that the HTMLUI control expects clear HTML strings while rendering. The issue in that sample is
tag is placed in-between the tr tag and the table tag like this, > >
SomeText
> >I have replaced it like this, > >
SomeText
> >Here is the modified sample: HTMLUIToImage.zip > >Please take a look at the sample and let me know if you have any concerns. > >Thanks, >Ajish. >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;