w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Libraries disappeared overnight
Try using the which command to see if the path to Python has changed. $ which python /usr/bin/python Most likely, your packages were installed in usr/bin/python and installing ipython changed it to something else.

Categories : Python

Virtual application on Azure has RoleEnvironment.IsAvailable == false overnight
I finally understand what happened. When I upgraded to Azure SDK 2.0, it updated only the Azure web role project, not the web applications projects, which were still referencing the SDK 1.7 DLLs. But no one noticed and it worked for a while. Lukos is probably right : Microsoft made some changes to their VMs, and the GAC now only contains the DLLs for 2.0 (since my deployment is targeting 2.0). I made the necessary changes to my web applications (switching the DLLs) and now everything is fine.

Categories : Azure

Adobe Illustrator CS 6 17.0.0 Pipette gives "wrong" color?
Adobes pipette reads only the RGB values and calculates the CMYK values even if the document is in CMYK - Mode. If you make a small calculation than you can see that CMYK can hold about 10^8 numbers (100 C; * 100 M; * 100 Y; * 100 K;) while RGB can only hold 16,7 * 10^6 (R 256; * G 256; * B 256) which gives a gab of 83*10^6 values. So there is more than one value in CMYK that gives the same RGB value as another CMYK value.

Categories : Pdf

Scripting Adobe Illustrator. How to apply an effect?
Using documents[0].selection[0].reflect.properties in ExtendScript toolkit to find out what properties basic paths have, I don’t see any way to set this effect directly. When I search the JavaScript Reference for Illustrator, the only mention I see of appearance is when it talks about graphic styles. So what I tried was drawing two rectangles, applying the 3D effect to one of them, and saving it as a new graphic style: Then in the script, you can select the other rectangle and then apply the graphic style with documents[0].graphicStyles[6].applyTo(documents[0].selection[0]) Unfortunately, the documentation does say Scripts cannot create new graphic styles. One thing that might be work would be to distribute a document with the script that has all the graphic styles you

Categories : Javascript

How does polyline simplification in Adobe Illustrator work?
I came across the question Smoothing a hand-drawn curve (which this question might actually be a dupe of), which has an answer that proposes using Ramer-Douglas-Peucker and then applying curve fitting according to Philip J. Schneiders approach. A quick adaptation of the provided sample code to my drawing methods results in the following curve: The input data from the question has been reduced to 28 points (which are being drawn using Bezier splines). I'm not sure which approach exactly Adobe is using, but this one serves me extremely well so far. Adaptation So, the code provided by Kris is written for WPF and makes some assumptions in that regard. To work for my case (and because I didn't want to adjust his code), I wrote the following snippet: private List<Point> OptimizeCur

Categories : C#

How to save as SVGZ with external stylesheets in Illustrator
I don't know whether SVGZ will work with CSS but SVGZ is a SVG compressed with GZIP. You can change SVG to SVGZ this way: get SVG file : example.svg remove extension .svg : example compress using GZIP : example.gz change extenson to .svgz : example.svgz

Categories : CSS

How to write a script that does "Save for web" for mutiple resolutions in Adobe Illustrator?
For that i myself use this function function saveDocumentAsPng(d, width, height) { var fileName = d.fullName.toString(); if(fileName.lastIndexOf(".") >= 0) { fileName = fileName.substr(0, fileName.lastIndexOf("."));} fileName += "_wxh.png".replace("w", width).replace("h", height); var exportOptions = new ExportOptionsPNG24(); exportOptions.horizontalScale = exportOptions.verticalScale = 100 * Math.max(width/d.width, height/d.height); var file = new File(fileName); app.activeDocument = d; d.exportFile(file, ExportType.PNG24, exportOptions); } Note that it names a resulting png's with “_[width]x[height]” suffix. I wrote my function based on a sample from adobe's javascript reference http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/dev

Categories : Misc

Adobe Illustrator expanded objects not generating image map code.
You can try to save it as an SVG. See: http://davidlynch.org/blog/2008/03/creating-an-image-map-from-svg/

Categories : HTML

Cannot set the printBlack printPreference in InDesign
After asking this question on the Adobe Community Forums, I was told that some of the Print Preferences cannot be set directly on the document, but must instead be set on a Print Preset, which, in turn, is then set as the Active Print Preset. Thus, I just re-built the preset I needed and assigned it to a new, temporary one. The following is the result: try { tempPreset.name; } catch(eNoSuchPreset) { tempPreset = app.printerPresets.add({name:"tempPreset"}); } // Let's turn off all of the spot colors before everything else. for (var j = 0; j < allInks.length; j++) { document.inks.item(allInks[j]).printInk = false; } with(document.printPreferences) { tempPreset.printer = Printer.POSTSCRIPT_FILE; tempPr

Categories : Javascript

How do I integrate an InDesign PDF into my rails app
You can export a file using InDesign javascript or applescript. For example, to export the currently open document to the desktop on a mac: var doc = app.activeDocument; var outputFile = File("~/Desktop/temp.pdf"); doc.asynchronousExportFile(ExportFormat.pdfType, outputFile); If you're looking for something a little more involved, take a look at IDMLlib or InDesign Server. They might contain the functionality you need, although I don't have any experience with them.

Categories : Ruby On Rails

How do I resize a page in InDesign?
Maybe this will help you? http://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs5_docs/indesign_scripting/guide-en-US/InDesignCS5_ScriptingGuide_JS.pdf page 39?

Categories : Javascript

Adobe Indesign MailMerge Performance
I tested this script (with a bit fix) on CS5 Jp version (not ID Server) / OSX 10.7 here is a question, taking 10sec include data merging? or only exporting pdf? can you use asynchronousExportFile() method? this exports pdf X4 faster for me. // ~> DATA MERGING HERE var s1 = new Date().getTime(); myDocument.exportFile(ExportFormat.pdfType, File(_Path_PDF), false, app.pdfExportPresets.item("[プレス品質]")); $.writeln(new Date().getTime() - s1); // -> 399 var s2 = new Date().getTime(); myDocument.asynchronousExportFile(ExportFormat.pdfType, File(_Path_PDF2), false, app.pdfExportPresets.item("[プレス品質]")); $.writeln(new Date().getTime() - s2); // -> 108

Categories : Performance

Elements move when exporting to pdf in Indesign cs5
I had a similar problem in Indesign CC Masterpage elements that were 'released' and moved on regular pages, reappeared as duplicates in the pdf on their original masterpage location. The elements in question were groups. Ungrouping solved the problem. HTH Willem van den Goorbergh

Categories : Misc

Reference a textFrame in InDesign by part of its name
If you want to find a TextFrame that contains the word "Other", you might try something like this: app.findTextPreferences = NothingEnum.NOTHING; app.findTextPreferences.findWhat = "Other"; var textArray = document.findText(); var textFrame = textArray[0].parentTextFrames[0]; If you want to find a TextFrame whose name contains "Other", then you'll probably need to search for it yourself: var textFrame = findTextFrame("Other"); function findTextFrame(searchStr) { var textFramesArray = document.textFrames.everyItem().getElements(); for (var i = 0; i < textFramesArray.length; i++) { var textFrame = textFramesArray[i]; if (textFrame.name.indexOf(searchStr) != -1) { return textFrame; } } } Note that either approach could find multiple ma

Categories : Javascript

Selecting textFrames inside of a group in InDesign CS6
Try this: // this script needs: // - a document with one page // - some groups with textframes in it on the first page var pg = app.activeDocument.pages[0]; var groups = pg.groups; var tf_ingroup_counter = 0; for(var g = 0; g < groups.length;g++){ var grp = groups[g]; for(var t = 0; t < grp.textFrames.length;t++){ var tf = grp.textFrames[t]; if(tf instanceof TextFrame){ tf_ingroup_counter++; } } } alert("I found on page " + pg.name +" " + pg.textFrames.length +" textframes Oh and there are also " +tf_ingroup_counter+ " hidden in groups");

Categories : Javascript

Finding a textFrame in InDesign based upon its geometricBounds
Answered my own question again with more exploration. I discovered that the if statement cannot understand a two-way test such as 0 < x < 1. Thus, I had to break it into four tests, as such: var textFramesArray = document.layers.item("Product Name").textFrames.everyItem().getElements(); var corners; for (var i = 0; i < textFramesArray.length; i++) { corners = textFramesArray[i].geometricBounds; if (7 < corners[0] && corners[0] < 8 && 0 < corners[1] && corners[1] < 1) { var productFrame = textFramesArray[i]; } } This finally works, so if anyone else wasn't aware of this limitation, now you know how you get around it.

Categories : Javascript

How to properly remove hyperlinks from inDesign Document using Extendscript?
Hyperlinks consist of several different parts, and you have to take care to remove every one of them. A single 'hyperlink' object is only sort of an abstract container object; it contains references to the hyperlinked item and to its destination. Try this: app.activeDocument.hyperlinkTextDestinations.everyItem().remove(); app.activeDocument.hyperlinkTextSources.everyItem().remove(); app.activeDocument.hyperlinks.everyItem().remove();

Categories : Misc

InDesign Server 5.5 Multiple page sizes in one document
I am still unable to find a solution to this problem. You may still answer if you want. :) The approach I did was to create different PDF files w/ different page sizes and then merge them using PDFBox.

Categories : Java

InDesign ScriptUI windows disappearing immediately after appearing
If you run it from ESTK it works. At least in my IDCC. But to make it run from the ID Scripts Panel you have to add: #targetengine'foo'; at the beginning of your script. (or any other targetengine) Be aware that all globals in the #targetengine 'foo' will exist until you close InDesign. So you should wrap your script into a function. Also I would recommend using return instead of exit()

Categories : Javascript

How can I gradually change font across a text frame in InDesign?
this should do the trick to change the font sizes of a characters, words and lines ... for a sentence based interpolation you have to parse the content of the text frame according to '.' ... and then iterate in a second step over the individual groups of characters for each sentence. sadly indesign doesn't have a built-in collection for sentences. hope that helps. #includepath "~/Documents/;%USERPROFILE%Documents"; #include "basiljs/bundle/basil.js"; function draw() { var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam pellentesque ultrices dolor, vitae venenatis erat."; var tf = b.text(lorem, 0, 0, 300, b.height); // replace words with characters/words/lines/ for (var i = 0; i < tf.words.length; i++) { tf.words[i].pointSize = b.map(i, 0,tf.words

Categories : Misc

How do I place an image in a text frame using javascript in Indesign?
So you have a text frame (filled with your data) and you want to replace it with an image? Use this -- the first line assumes you selected your text frame, but of course you can replace it with the reference: a_frame = app.selection[0]; a_frame.place (File(Folder.myDocuments+'/yourImageName.png'), false); a_frame.fit (FitOptions.CONTENT_TO_FRAME); a_frame.fit (FitOptions.PROPORTIONALLY); a_frame.fit (FitOptions.CENTER_CONTENT); See TextFrame.place for "place", and TextFrame.fit for "fitting". It doesn't actually matter you are using TextFrame commands here to place and fit an image -- all ID uses is its frame. The 3 FitOptions in a row ensure that 1. the entire image fits inside your frame, but most likely out of proportion; 2. scales down proportionally; and 3. centers the image insi

Categories : Javascript

Can an InDesign file be seamlessly exported as a working website?
You can only export images and text, no links, drawings, lines, etc. http://helpx.adobe.com/indesign/using/export-content-html-cs5-5.html

Categories : Misc

InDesign CS6 Script to Change Style based on XML Attribute not working
you will want to use the correct xPath Expression to match your paragraphs var subheadElementList = rootElement.evaluateXPathExpression("//*[@class = 'boxtitle']"); or more specific if your paragraphs have the markupTag name "mypara" for Example: var subheadElementList = rootElement.evaluateXPathExpression("//mypara[@class = 'boxtitle']");

Categories : Javascript

evaluate XPath expression not working for attribute (xml:lang) in indesign
InDesign has several problems with namespaces. They better work when you use the "XML" object of ExtendScript, or if you don't use them at all (e.g. strip/replace them via an XSLT on import). When I provided the namespace declaration for the xml namespace (even though redundant by the words of the standard), my InDesign CS6 found your para. E.g. tell application "Adobe InDesign CS6" tell XML element 1 of active document make XML attribute with properties {name:"xmlns:xml", value:"http://www.w3.org/XML/1998/namespace"} evaluate XPath expression using "//para" end tell end tell

Categories : Xml

Indesign (Javascript) footnote as crossref destination destroys numbering
fixed it: i just flipped the order of making the crossrefs. i flipped the following lines backlink_destination = doc.paragraphDestinations.add (footn[i].storyOffset); endnote_destination = doc.paragraphDestinations.add (endnote.insertionPoints[0]); to endnote_destination = doc.paragraphDestinations.add (endnote.insertionPoints[0]); backlink_destination = doc.paragraphDestinations.add (footn[i].storyOffset); and backlink_source = doc.crossReferenceSources.add (endnote, crb); endnote_source = doc.crossReferenceSources.add (footn[i].storyOffset, note_styles.cr_format); to endnote_source = doc.crossReferenceSources.add (footn[i].storyOffset, note_styles.cr_format); backlink_source = doc.crossReferenceSources.add (endnote, crb); and doc.hyperlinks.add(backlink_source, backlink_de

Categories : Javascript

How can I convert an SVG file to a format read by Cinema 4D as Vector (like Adobe Illustrator ai file)
I use a tool called VectorMagic (http://vectormagic.com/home) it will take any image and convert it to EPS, SVG, PDF, AI, DXF and EMF. Works seamlessly with Illustrator, Corel, and others.

Categories : Misc

How to bring Classic Text From Adobe Illustrator to Adobe Flash Professional?
I must be doing something wrong because the people at Adobe really cannot be that dumb to force developers to do this every time you move graphics from Illustrator to Flash Pro Haha. Good joke. This is the tip of the iceberg when it comes to stupid things that Adobe software does. In my role I do a lot of Flash banners, and the designers use Fireworks. I've done 500+ banners since starting work and almost every single one has needed the text fields to be readjusted once they're imported. The line and letter spacing is never the same, the size doesn't translate correctly, etc. If you don't actually need to the text to be editable, you could consider outlining it before you import it. This way, you'll have the same result when you copy and paste it. This may not be the best solution

Categories : Actionscript

Convert auto page numbers special character to actual value in InDesign document
Ok, I think I've worked it out. main(); function main(){ app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; app.findGrepPreferences.findWhat="~N"; var FindGrep=app.activeDocument.findGrep(); for(i=0; i<FindGrep.length; i++) { var item = FindGrep[i]; var page = item.parentTextFrames[0].parentPage; item.contents = page.name; } alert("done"); } Struggled to find any valuable documentation from Adobe. This really helped: http://jongware.mit.edu/idcs5/ As well as this SO question: Get current page number in InDesign CS5 from Javascript Edit: If your page numbering is in a master, you will need to "override all page master items" (check the pages palette) Edit 2: This worked on inDesign 5.5 (not s

Categories : Misc

c# WPF UI freeze after using MemoryStream
It is a little bit late, but I would like to add some more information. The problem is that you are using a synchronous call which uses the UI thread, unlike all other synchronous calls, this call takes some time, and therefore, your application is frozen until the call will finish. You need to use an asynchronous call, so that your UI thread will be free, so the UI will not be frozen. There are many ways to make an asynchronous calls, such as opening a new task, thread, or my preferable way, is to use the async await, which is very great - you can write a synchronous code, and to add async and await in the right places, and woops - it is an asynchronous code! To read more about async await click here.

Categories : C#

How can an App freeze Android OS
Where is your code sample above located? It should be be on a UI thread, potentially blocking user interaction. Are you also getting ANR messages before the freeze? thread.join(); will block indefinitely. See Thread.join() documentation. Also, the following looks like a busy loop to me. What are you doing at the comment? If nothing, then the loop will spin like crazy (think while (true) { }). while(thread.getState() != Thread.State.TERMINATED){ // wait until thread finishes }

Categories : Android

PHP Mail freeze
Try to debug by making php to show the error logs. You can use below code by placing it at top of your php code as: <?php error_reporting(-1); ?> Another thing i noticed in your email sending code is that it does not contain headers. Headers are necessary for an email functionality to work properly. <?php $to = "testing@example.com"; $subject = "Test mail"; $message = "This is a test email message."; $from = "testing1@example.com"; $headers = "From:" . $from; if(mail($to,$subject,$message,$headers)){ echo "Mail is Sent."; }else{ echo "Mail not sent."; } ?>

Categories : PHP

ACM Interactors Freeze
As a workaround, in addition to using Java 1.5, add the field to the NORTH. Also, you may want to extend GraphicsProgram. Modified SSCCE: import acm.program.*; import java.awt.event.*; import javax.swing.*; public class TextFieldExample extends GraphicsProgram { @Override public void init() { nameField = new JTextField(15); add(new JLabel("Name: "), NORTH); add(nameField, NORTH); nameField.addActionListener(this); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == nameField) { println("Hello, " + nameField.getText()); } } private JTextField nameField; }

Categories : Java

freeze top row using spreadsheetgear
After some research I found out I need to select the cell first and then set the FreezePanes property: worksheet.Cells[1,0].Select(); worksheet.WindowInfo.FreezePanes = true; Basically what happens is it freezes rows above and columns to the left of the selected cell.

Categories : C#

pip freeze for Node and npm
You can create a package.json out of the currently installed package using npm init. Then you can easily move the package.json and simply do npm install to install the packages wherever you want.

Categories : Node Js

How to script InDesign/InCopy to "Check In" and "Check Out" textFrames?
Do you have any code that you've tried so far? I'm taking a stab in the dark here, but I might start off with something like this: var story = textFrame.parentStory; story.checkOut(); story.contents += " This is added to the end."; story.checkIn(); story.recompose(); var linksArr = document.links.everyItem().getElements(); for (var i = 0; i < linksArr.length; i++) { linksArr[i].update(); }

Categories : Javascript

All JFrame freeze while do JavaMail
When you do heavy task you should run them in another threads rather in the same as gui. If you run in Event Dispatch Thread then the gui is gonna freeze until finish. You can use SwingWorker here is an example i really like Swing Worker Example Example: class Worker extends SwingWorker<String, Object> { @Override     protected String doInBackground() throws Exception { //here you send the mail return "DONE";     }     @Override     protected void done() {         super.done();         //this is executed in the EDT JOptionPane.showMessageDialog(null, "Message sent", "Success", JOptionPane.INFORMATION_MESSAGE);     } }

Categories : Java

Python cx-freeze issue
You're using wrong command: freeze.py in pip/commands directory is for pip freeze command. Use cxfreeze program. cxfreeze /home/frost/Desktop/dd.py See cxfreeze script for usage detail.

Categories : Python

UIActivityViewController freeze in first time
I don't really understand the problem - you alloc/init a UIActivityViewController and then you present it with presentViewController:animated:completion, correct? Make sure to call the presentViewController... on the main thread. Sometimes UI stuff called on the wrong thread takes seconds to get executed. But it might also just be iOS - UIActivityViewController takes some time to check for available services and stuff, that might be the thing that's slowing it down too.

Categories : Iphone

.each() makes the page Freeze
The following will solve the issue by adding all the html at once, this will be faster than the other method...it will still lock the DOM at the end when it adds the html variable to the html of the parent element. var html = ''; $('.calling-div').each(function() { var fetch_id=$(this).attr('data-id'); $.ajax( { type: "POST", url: "page-url", data: {var1: fetch_id}, dataType:"html", success: function(data) { html += "<div class='calling-div' id='calling-div-" + fetch_id + "'>" + data + "</div>" } }); // Ajax }); // Each function $('.caller-div-holder').html(html); Special Note I highly recommend using the following to solve this problem: jQuery append() for multiple elements after for loop without flattening to H

Categories : PHP

JS Causing browsers to freeze
You are running a multitude of setInterval() calls, so the event queue gets crowded with your function. I think, what you mean is more like setTimeout() at the end of your function. function countdownProcedure(){ // all your logic setTimeout(countdownProcedure,interval); }; The difference is, that setInterval() will run your code every x seconds, until you tell it to stop. setTimeout() on the other hand, just runs your code once after x seconds.

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.