InDesign CS5 Script: How can I place another InDesign document into a new InDesign document? - document

I am creating a new InDesign document with var newDoc = app.documents.add() .
I am trying to place another pre-existing InDesign document that has paragraph styles into the new document. The reason why I'm not simply using styledDocument.execute() is that it opens this pre-existing document, whereas I want the document itself to be "Untitled".
I am attempting to do this with newDoc.place(styledDocument) , which is not working. The document is untitled as intended, but has the styled document as a link only, and is not populating the Paragrah Styles window with the styles from the styled document...
It is possible from File --> Place... in the InDesign menu to open another InDesign document into this one manually, in which the styles from this document do appear in the Paragrah Styles window... But I want to programmatically do this. So, I am assuming that File --> Place... from the InDesign menu is different than newDoc.place(oldDoc).
Here is my code (which is not working):
var newDoc = app.documents.add();
newDoc.place(styledDocument);

Wawawaaa, what is your final intention ? Load styles from doc A into Doc B ? If that so, why not use the document's importStyles method ?
If you do want to import document as an image, you can use the place method and specify the document as any other image file.

Related

Disable hyperlinks in generated PDF using Puppeteer

Is there a way to disable auto generated hyperlinks from pdf. For example, I have a string https://example.com/, after converting from html to pdf using Puppeteer, it automatically converts the string to an hyperlink, which does not exist.
Is there a flag or something in Chromium or puppeteer to disable auto linkification.
Puppeteer does not add any links to the PDF document that are not actually present in the page. It is very likely your PDF viewer that is adding these links.
Try it yourself.
Upload your PDF to this viewer (that uses PDF.js), button is in the top right. This viewer does not add any links to the document. If the link is not clickable in this document, your PDF viewer is adding the links.

How to achieve header, footer and pages features like MS-office document in tinyMCE/ckeditor?

My application users can import ms-office document (docx) content to the editor(tinyMCE/Ckeditor) or export the editor content to docx. So the problem is, Header and footer of docx will not behave as such.
Added i want docx pages functionality into the editor like page 1, page 2 and etc.,
I have tried with document editor functionality on Ckeditor - https://ckeditor.com/ckeditor-4/demo/#document, but it is not satisfying my expectation.
My application is with Angular 7 and Node JS.
can somebody give me alternate solution to achieve this kind of functionality.

Merging PDFs in one file and add page numbers with PDFsharp/MigraDoc

Searching examples could not find a way to add page numbering using MigraDoc to existing PDFs.
So I have:
PdfDocument outPdf = new PdfDocument()
var pdfFile = PdfReader.Open(new MemoryStream(pdfData), PdfDocumentOpenMode.Import))
CopyPages(pdfFile, outPdf)
How to add here a Section, Paragraph, Footer/Header?
The code you are showing uses PDFsharp, not MigraDoc.
MigraDoc cannot alter PDF documents. It can create PDF documents - with headers, footers, page numbers.
PDFsharp can alter PDF pages.
See this answer for a code sample:
https://stackoverflow.com/a/34998271/1015447

Adding a data field/property to a bookmark in a chrome extension

Im starting a new project to morrow where im going to create a new chrome extension. In my extension I will need to set labels on my bookmarks to do this I would like to set the labels on the bookmark object reyrived from the Api is there a way to do this?
The chrome.bookmarks API (and the bookmark feature in Chrome, in general) only offers the option to set a title and URL (and a folder, if desired).
There's no supported way of adding other fields.
If you still want to add some kind of tag (without bookmark folders), just insert them in the title field.

SP2010 Content Editor: add text to paragraph by default

Is there a way to make the Content Editor (RichHtmlField) in SP2010 add newly inserted text to a paragraph (with the default paragraph style ms-rteElement-P). I have changed said css class to how I want the body text to be formatted and I want to eliminate the step of selecting the Markup Styles -> Paragraph style manually when a user starts to add content.
There is no out-of-the-box way, but you could use JavaScript to always add default content to any content editor on a page. Another way would be to create your own WebPart deriving from the Content Editor WebPart, but that sure is a lot more work.
I got an answer here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/65152576-9432-4d55-a2e1-c798975859d5
Hi,
You have to override the PrefixStyleSheet property of the RichHtmlField control.
Here is some more information about that: http://msdn.microsoft.com/en-us/library/ms551040.aspx
Hope this helps!
Regards, Sjoukje

Resources