Issues after converting pdf to docx

Hi.

I have a main pdf file with placeholders and I want to replace placeholders with other pdf files, which are placed in Additional_Docs folder. To do this, I convert all pdf files to docx files first (You can see all pdf folders in Ecrion_Templates folder, Additional_Docs folder of the Input folder.) Then I replace all placeholders of main file (which is converted to ΤΣΙΓ_ΝΔ_3_0025.docx file) with additional docs to it, so there is a bigger docx file. When finished, I save both a docx file and a pdf file in Output folder. Finally, I compress pdf file, so it has a smaller size.

I saw that the “ΤΣΙΓ_ΝΔ_3_0025.docx” file has some issues in tables (lines, fields). This problem remains in pdf file also. Is there a way I can fix those problems? I had some issues with Greek fonts and images in the past, that’s why I decided to convert pdf to docx before replace takes place. But then, I have another problem with tables and it’s cells in ΤΣΙΓ_ΝΔ_3_0025_Output.docx, ΤΣΙΓ_ΝΔ_3_0025_Output.pdf. I have drawn a red rectangle to show the problem in ΤΣΙΓ_ΝΔ_3_0025_Output.pdf, which is the output file. Also, I would like to be advised on how could I improve compression, when I have larger files.
I attach all required files.

Project_Horizon.zip (2.1 MB)

Agwges.zip (17.3 KB)

ΤΣΙΓ_ΝΔ_3_0025_Output.pdf (7.7 MB)

@panCognity

We are checking it and will get back to you shortly.

@panCognity

We tested your project using 24.1 version of the APIs in our environment. We were able to notice the issue in the table formatting in the final output PDF. However, we noticed an error on the following line#165 in DocManipulation.cs:

pdfFilesInFolder.AddRange(Directory.GetFiles(directory, "*.pdf", SearchOption.TopDirectoryOnly));

Can you please check what error is it in your application? After bypassing this error, we were finally able to reproduce the table formatting issue. It has been logged under the ticket ID PDFNET-56326 in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.

I tested again and I don’t have that kind of error in line 165, as you mentioned. Is there any update on the issue?

@panCognity

The error was about some missing file. Nevertheless, we were still able to replicate the issue in the final output PDF regarding table style and formatting. The logged ticket is about to investigate and address the issue. It will be prioritized on first come first serve basis and as soon as it is resolved, we will notify you in this forum thread. Please spare us some time.

1 Like

Thank you for letting me know.

Hope to hearing from you soon.

I was thinking if there is another solution for now, to be able to move on. I don’t know if I will have any issues with tables, but I would like to try, just in case. Could it be possible to replace text (placeholders) in my main pdf file with those from other pdf files, if I preserve all my documents as pdf files? For example, my main document is in Ecrion_Templates\Agwges folder named as ΤΣΙΓ_ΝΔ_3_0025.pdf and my other pdf documents are in folder Additional_Docs. Could I replace text in main pdf with those pdf files in Additional Docs? I have for example [4037156482_Simvasi] placeholder in ΤΣΙΓ_ΝΔ_3_0025.pdf and I would like to replace it with ΣΥΜΒΑΣΗ.pdf from folder 4037156482 in Additional_Docs. I would greatly appreciate some guidance on how I can replace text with a pdf file.

@panCognity

We think you mean you would like to replace the text with 4037156482 from ΣΥΜΒΑΣΗ.pdf in Additional_Docs folder. Right?

Aspose.PDF for .NET does provide features for text replacements. Please check below documentation article(s) for more information and code samples.

I want to replace text e.g. [4037156482_Simvasi] of ΤΣΙΓ_ΝΔ_3_0025.pdf with the whole pdf document ΣΥΜΒΑΣΗ.pdf from folder 4037156482 in Additional_Docs. I cannot find a way in your documentation. So, my question is: How should I do this?

(If you look at my code earlier in this thread, I replace placeholders with word documents from other folders in my main document. Can I do that by simply use all documents (main and additionals) as Pdf Documents?)

@panCognity

Aspose.PDF offers PageStamp that can be used to stamp entire PDF page in other PDF document. A PdfPageStamp can be used when you need to apply a composite stamp containing graphics, text, tables. However, we are not certain that it would suit the actual requirements you have. You can however explore this feature and share your feedback with us.

You mentioned earlier that PdfPageStamp is used to stamp PDF files like logos, watermarks, and signatures. In my case, I need something like merging pdfs or appending pdfs if I want to use all my documents as pdfs. Since my client is a large organization who has purchased your license, I will wait for your response to the logged ticket. Please let me know as soon as possible.

@panCognity

Sure, we will prioritize the logged ticket on a first come first serve basis and as soon as it is resolved, we will inform you in this forum thread. Please spare us some time.

1 Like

My client, which is a large organization (bank), asks your Sales Team the following:

Dear team,

We need to resolve the issue bellow ASAP, in order to complete the UAT and to proceed with the Golive.

Issues after converting pdf to docx - Free Support Forum - aspose.com

Please let me know to whom I should address this e-mail, in order to be handled as an escalation.

@panCognity

In case you need to escalate your ticket priority using Paid Support, you may please contact to our Sales Team in purchase forum to subscribe to paid support services.