Word to Pdf conversion issue - Unwanted metadata on top of the generated Pdf document

Last post 02-06-2011, 7:34 AM by aspose.notifier. 5 replies.
Sort Posts: Previous Next
  •  10-19-2009, 4:02 AM 202979

    Word to Pdf conversion issue - Unwanted metadata on top of the generated Pdf document .NET

    Attachment: Present (inaccessible)

    Hi there,

    I'm using the SaveToPdf(string fileName) method in the Aspose.Words.Document class. The conversion from word to pdf is normally going really well, but for some documents the generated pdf file will have some unwanted metadata on top. It looks like custom properties set on the word document. I'm not sure why this is happening - so any suggestions to help me on this issue would be very much appreciated. For instance, is there any properties to set on the Aspose.Words.Document object to prevent this metadata from showing in the generated pdf file?

    Attached to this post is the original word file, the generated pdf file after conversion and the unwanted metdata (highlighted).

    Please let me know if any further information is needed.

    Thanks and regards

    Geir

     
  •  10-19-2009, 6:06 AM 203006 in reply to 202979

    Re: Word to Pdf conversion issue - Unwanted metadata on top of the generated Pdf document

    Hi

     

    Thanks for your inquiry. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed. The problem occurs because there are SET fields in the header of the document.  

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  10-28-2009, 10:02 AM 204527 in reply to 203006

    Re: Word to Pdf conversion issue - Unwanted metadata on top of the generated Pdf document

    Hi Andrey,

    Thank you for your reply.

    I'm just wondering what the current status is on this issue? We have a customer who is waiting for this issue to be fixed, before they can go in production. Therefore it would be nice if we could give them an updated status.

    Best regards

    Geir

     
  •  10-28-2009, 1:30 PM 204571 in reply to 204527

    Re: Word to Pdf conversion issue - Unwanted metadata on top of the generated Pdf document

    Hi

     

    Thanks for your inquiry. Currently, I cannot provide you any reliable estimate. Please expect a reply before the next hotfix (within 4-5 weeks).

    For now, as a workaround, you can try removing SET fields from your document before converting it to PDF. For example, see the following code:

     

    Document doc = new Document(@"Test001\TheOriginalWordFile.doc");

    RemoveSetFields(doc);

    doc.Save(@"Test001\out.pdf");

     

    ===================================================================

     

    public  void RemoveSetFields(Document doc)

    {

        //Get collection of FieldStart nodes

        Node[] fieldStarts = doc.GetChildNodes(NodeType.FieldStart, true).ToArray();

     

        //Loop through all FieldStart nodes

        foreach (FieldStart start in fieldStarts)

        {

            // Skip further processing if start is not start of SET field.

            if(start.FieldType != FieldType.FieldSet)

                continue;

     

            // Remove all nodes between field start and field end

            Node curNode = start;

            while (curNode != null && curNode.NodeType != NodeType.FieldEnd)

            {

                Node nextNode = curNode.NextPreOrder(doc);

                curNode.Remove();

                curNode = nextNode;

            }

            // Remove field end.

            if (curNode != null)

                curNode.Remove();

        }

    }

     

    Hope this helps.

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  10-29-2009, 4:22 AM 204678 in reply to 204571

    Re: Word to Pdf conversion issue - Unwanted metadata on top of the generated Pdf document

    Hi Andrey,

    Once again, thank you for your quick reply. And thank you so much for the proposed workaround - it works like a charm! :)

    Best regards,

    Geir

     

     
  •  02-06-2011, 7:34 AM 283305 in reply to 202979

    Re: Word to Pdf conversion issue - Unwanted metadata on top of the generated Pdf document

    The issues you have found earlier (filed as 11158) have been fixed in this update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
    (46)
     
View as RSS news feed in XML