I tried word wrap with the below code:
|
I'm developing a pdf template where i'm not able to implement word wrap i.e after certain limit characters are getting cropped from the document. |
The text will be cropped when the text will not accommodate in the specified bounds. In this case we used the WordWrap to wrap the text to the next line. The given code snippet specified only the starting point of the text, so its takes single line to draw the text and text was cropped when beyond the page width. Kindly use RectangleF (x,y,width and height),so that the text will be wrap to the next line within the bounds, based on WordWrapType.
| |
|
And also while displaying the logo in the document, it is displayed with black background which originally has white background. |
We have drawn available different gif images to PDF document and all the images works as expected. The issue seems to be an image specific. Can you please share the input image file to reproduce the issue in our side and provide you the solution earlier? |
|
Image background black color issue. |
We have drawn the attached image in the word document by extracting the image and the image was preserved as expected without background color in output PDF. We have ensured in latest version 16.1451.0.37. Can you please share the image file alone without attached in the word document. Please find the output PDF document below for your reference.
Output PDF:
|
|
Text overlap issue |
· The WordWrapType will wrap the text based on the given bounds. The text will be overlap, if the given bounds overlap with the next continuous text bounds. So, make sure the bounds will not overlap with the other text.
· You can use PdfTextElement to wrap the text and using PdfLayoutResult will return the text bounds. Using PdfLayoutResult we can avoid overlapping and proceed draw the next continuous text based on the previous text position.
Please find the KB for paginating the text using PdfTextElement.
|