Image size and spacing issue

Hi @asad.ali,

This is regarding “Image logo and spacing issue” between the pdf file generated directly using aspose.pdf vs pdf file generated using aspose.cells conversion. The context is explained as below.

  1. PDF file generated using Aspose.Pdf - it is a straight forward approach, where read image first followed by row title and row data

  2. PDF file generated using Aspose.cells excel-to-pdf conversion approach - in this approach,
    a. first converting the excel file having the row title and row data to pdf file before converting to pdf adding few dummy rows in the first sheet at the beginning to reserve this space for inserting the image.
    b. load the pdf file generated in the first point
    c.
    pdf file generated using aspose excel-to-pdf conversion.zip (19.8 KB)

665.pdf (25.0 KB)

Please only check image and spacing only
add logo and other details

Now if you observe both the pdf files, you will find that both are not looking similar.

Please suggest to resolve this issue.

I have enclosed both the pdfs.

  1. pdf generated using aspose-pdf
  2. pdf generated using as-pose-excel conversion

@koteswaragunda

Can you please provide more details about the specific differences in image size and spacing that you are observing between the two PDF files?

I have enclosed the file, the details are, in the pdf file generated using conversion the image and logo are little right justified when compare with pdf generated directly. Can you please suggest
actual-pdf-gen-using-excel-to-pdf.png (96.4 KB)

expected rresult.png (77.4 KB)

@koteswaragunda

We have checked the files shared by you. Can you please share the code snippet that you have used to generate the PDF file with Aspose.PDF? Also, please share the logo image for our reference so that we can test the scenario in our environment and address it accordingly.

Hi @asad.ali sorry for the late response. Actually earlier we have used PDFBox api for pdf generation. When compared pdfs, observed that the, image generated using aspose is looking smaller in size and alignment and spacing are more. In my earlier post i have enclosed both the pdf files. So you can verify how image looks. So unable to provide older code as it was implemented in PdfBox api.

My requirement is,

  1. Load existing pdf file
  2. add image in the first page, top left corner and it should not overlap the existing data
  3. Also, next to image, A report name followed by
    horizontal line then followed by execution time

Please find the enclosed expected result in pdf.

Please suggest us a better implementation to achieve this
pdf-image-issue.png (15.2 KB)

@koteswaragunda

The right way to achieve the output that you expect is to use table approach. We have noticed that a ticket in our issue management system has already been opened for your case (in other thread) where image is not displaying while adding header table inside PDF document. In case there is another different scenario that you want to discuss in this thread, please let us know.