MallikarjunHt / Csharp-Adobe-Automation

Automating Adobe InDesign using C# programing
MIT License
0 stars 0 forks source link

Csharp-Adobe-Automation

Automating Adobe InDesign using C# programing

docTOIndd ➡️ import docx file and extract text and place in InDesign and sving file.

word manuplation => https://www.c-sharpcorner.com/forums/how-to-get-current-document-styles-from-word-document https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word.paragraphformat?view=word-pia

InDesign.Texts texts= (InDesign.Texts)frames.Texts;
InDesign.Text text = (InDesign.Text)texts.FirstItem();
 for (int i = 1; i <= application.Fonts.Count; i++)
                {
                    InDesign.Font font = (InDesign.Font)application.Fonts[i];
                    if(font.FullName.Equals("Acumin Variable Concept SemiCondensed Black Italic"))
                    {
                        text.AppliedFont = font;
                        break;
                    }
                } 
if(doc.Hyperlinks.Count > 0)
                {
                    for (int i = doc.Hyperlinks.Count; i >= 0; i--)
                    {
                        InDesign.Hyperlink hyperlink = (InDesign.Hyperlink)doc.Hyperlinks[i];
                        hyperlink.Delete();
                    }
                }

http://blog.gilbertconsulting.com/2007/10/use-grep-to-find-url.html

[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7} finds Email Both Email and URL [\S]+[.][\S]+ grep {finfwhat:"([\S]+[.][\S]+)"} {changeTo:"$1"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true} Find all Email and URL's and change Style.

application.WordRTFImportPreferences.ResolveCharacterStyleClash = InDesign.idResolveStyleClash.idResolveClashUseExisting;
application.WordRTFImportPreferences.ResolveParagraphStyleClash = InDesign.idResolveStyleClash.idResolveClashUseExisting;
application.WordRTFImportPreferences.ImportUnusedStyles = false;
application.WordRTFImportPreferences.ConvertBulletsAndNumbersToText = false;