Changes not visible in Adobe illustrator

  1. We are using PdfFileStamp Class to place multiple PDF’s in a one base PDF

  2. Also we are using TextFragmentAbsorber and TextFragmentCollection Classes for find and replacing text in PDF.

The above functions are working fine and changes reflected in output pdf file as expected but when we open the same file in adobe illustrator the changes are not reflected.

We have attached input and output files for your reference.

Note:

  1. The source pdf file was generated from adobe illustrator. Since we need a vector based file for printing.
  2. Aspose PDF version 23.5.0

Input 1.pdf (343.0 KB)
Input 2.pdf (302.0 KB)

Find and replace output.pdf (357.8 KB)
File stamping output.pdf (423.7 KB)

@kxsubramani

Would you please share the version of Adobe Illustrator along with screenshots of the files how it is not showing the modified content? We will log an investigation ticket and share the ID with you.

We are using Adobe illustrator 2023 (v27.5).

Please find the screen capture.

Find and replace.jpg (208.5 KB)

@kxsubramani

We apologize for the trouble as we forgot to request for sample code. We need to investigate the actual reason behind this behavior and it is expected to be related with Adobe Illustrator. Nevertheless, we are logging an investigation task to carry out the analysis. Can you please share sample code snippet that you are using to add stamp and perform replace functionality? It would help us in investigating the scenario accordingly.

Hi @asad.ali,
behalf of @kxsubramani

Here is the Sample code we used for

  1. Find and replace Text :
   private static void FindAndReplaceText()
   {
       Document pdfDocument = new Document(@"input.pdf");
       TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("EMAIL");
       textFragmentAbsorber.TextReplaceOptions.ReplaceAdjustmentAction = 
       TextReplaceOptions.ReplaceAdjustment.None;

       pdfDocument.Pages.Accept(textFragmentAbsorber);
       TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;

       foreach (TextFragment textFragment in textFragmentCollection)
       {
           textFragment.Text = "sample replaced text";
       }

       pdfDocument.Save(@"Output.pdf");
   }
  1. Add stamp to PDF
    private static void GeneratedPrintLayout()
    {
        string dataDir = @"C:Desktop\samples\";
        float originX = 0;
        float originY = 10;

        Document pdfDocument = new(dataDir + "Layout.pdf");
        PdfFileStamp fileStamp = new(pdfDocument);

        for (int i = 0; i < 4; i++)
        {
            Aspose.Pdf.Facades.Stamp stamp = new();
            stamp.BindPdf(dataDir + "Input_1.pdf", 1);

            stamp.SetOrigin(originX, originY);

            if (i == 3)
                stamp.Rotation = 90.0F;

            fileStamp.AddStamp(stamp);
            originX += 250;
        }
        fileStamp.Save(dataDir + @"output.pdf");
    }

@kxsubramani

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54810

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.