PDF XChange viewer CMD print flashing - printing

when I use PDF XChange viewer print pdf file in command line.
the command like this PDFXCview.exe /print file.pdf.
it work, but my cmd out of focus and then about one second later it focus again.
it looks like flashing when call PDFXCview.exe.
The experience is a little bad, how can i handle it.

Related

How to copy from nvim to clipboard. (nvim remote or in Docker)

I can't figure out how to copy from vim, and paste to another console tab.
For instance, I'm using the preconfigured nvimdocker / ansible-neovim-pyright container. I did try:
set mouse= I can copy/paste with middle click, but I get the column with line numbers in the clipboard. Makes it unpracticable to copy few lines of script.
set mouse=nv This is great, I can select the text without the line numbers. Potentially right-click->Copy. But none of the * (highlight clipboard) nor + (system clipboard) registers are working. (None of the middle-click or explicit paste will work).
Obviously, it's not possible to access the system clipboard from remote, and xclip cannot help. I think the problem is similar when using a remote nvim through SSH (with no X redirection).
But how could I have the 'highlight' clipboard ? Is there maybe a (n)vim command to temporarily disable the left column with numbers/git/modifs/coc-errors ?
Thanks,

Saving image in plot window after placing points in plot

Using Octave, I am able to show a image and then plot some red circles over it, as follow:
tux = imread('tux.png');
imshow(tux);
hold on;
plot(100,100,'r','markersize', 10);
plot(150,200,'r','markersize', 10);
The above code display this window:
My question is: How can I save this image as it is being showed inside the window?
Thank you very much!
Pretty simple. Use:
print -djpg image.jpg
print is a command in Octave that allows you to capture what's currently seen in the current figure window. -d specifies what output device you want to write to. There are multiple "devices" you can use to save to file... EPS, PS, TEX, etc. A device can also be an image writer, and so here I chose JPEG. You can choose other valid image formats that are supported by Octave. Take a look at the link I provided above for more details.
After, you just specify what file name you want to save the plot to. In this case, I chose image.jpg.
You can also take a look at saveas. Make sure you get a handle to the current figure first before doing so:
h = gcf;
saveas(h, "image.jpg");
Also... a more point-and-click approach would be to Go to File -> Save As in the figure that your image is displayed in :)
You can use print to save your plot to a file:
print (FILENAME, OPTIONS) // for the current figure
print (H, FILENAME, OPTIONS) // for the figure handle H
and also take a look to saveas
saveas (H, FILENAME)

How to print an excel document from command line with PRINT command in MSDOS

Im trying to print an excel document through a default printer configured from command prompt using PRINT command as shown below:
C:>print c:\printdocs\test1.xls
by typing above and pressing enter a line saying 'C:\test1.xls is currently being printed'
is getting displayed but the excel document is not sent for default printer for printing. Please help me with this, where iam going wrong.
print.exe is designed to print a text file, and nothing else. In fact, if you type print /? from a command prompt, it tells you that in the first line of the text:
C:\>print /?
Prints a text file.
PRINT [/D:device] [[drive:][path]filename[...]]
/D:device Specifies a print device.
So the answer to your question is that you can't print an Excel file via print from the command line, because an .XLS file isn't a text file.

cv2.imshow() function is opening a window that always says not responding - python opencv

I am trying to run a very simple program. To open and jpg file and display it using the opencv library for python. Initially it all worked fine but now it just opens a window which doesn't show the image but says 'not responding'. I need to go to the task manager and close it!
from numpy import *
import matplotlib as plt
import cv2
img = cv2.imread('amandapeet.jpg')
print img.shape
cv2.imshow('Amanda', img)
You missed one more line:
cv2.waitKey(0)
Then the window shows the image until you press any key on keyboard. Or you can pass as following:
cv2.waitKey(1000)
cv2.destroyAllWindows()
Here, window shows image for 1000 ms, or 1 second. After that, the window would disappear itself. But in some cases, it won't. So you can forcefully destroy it using cv2.destroyAllWindows()
Please read more tutorials first : http://docs.opencv.org/trunk/doc/py_tutorials/py_tutorials.html
None of the answers here worked in MacOS. The following works:
Just add a cv2.waitKey(1) after cv2.destroyAllWindows().
Example:
import cv2
image = cv2.imread('my_image.jpg')
cv2.imshow('HSV image', hsv_image); cv2.waitKey(0); cv2.destroyAllWindows(); cv2.waitKey(1)
The solution that worked for me:
Switch from inline graphics to auto. It worked both in Spyder and in Jupyter notebooks.
To change Spyder setting:
Go to Tools > Preferences > IPhyton console > Graphics > Backend: Automatic
(Change backend from Inline to Automatic)
To change Notebook setting:
Enter command:
%matplotlib auto
Some background for my case (for those who may be quick to judge):
It used to work fine: I could open an image, it would load, and it would be responsive (doesn't say "Not responding", can close, focus, etc.) Then I installed some packages and ran some demo notebooks that apparently messed up some settings (Spyder open files were reset too).
I tried adding waitKey(1) (and 0, 30, 1000, etc values too). It made the image load, at least. But the image frame was "Not Responding": didn't refresh, couldn't close, didn't come to top, etc. Had to close using cv2.destroyAllWindows().
Note that everything worked fine during the duration of waitKey. I put this in a loop that shows the same image in the same named window and waits for a few seconds. During the loop everything works fine. As soon as the loop ends, the image window is "Not responding" (which looks like a GUI thread issue). I tried using cv2.startWindowThread(), and didn't make any difference.
Finally, changing from Inline graphics to Auto brought everything back to order.
I've been working with opencv 3.2 and matplotlib too recently and discovered (through trial and error of commenting out lines) that the import of pyplot from matplotlib has some sort of interference with the cv2.imshow() function. I'm not sure why or how it really works but in case anyone searches for this issue and comes across this old forum, this might help. I'm working to try to find a solution around this interference bu
I did also face the same issue. I am running through command line python prompt in centos 7 with the following code
>> import cv2, numpy as np
>> cap=cv2.VideoCapture(0)
>> img=cap.read()
>> cap.release()
>> cv2.imshow('image',img[1])
>> cv2.waitKey(0)
>> cv2.destroyAllWindows()
>> cv2.waitKey(1)
Even then the problem persisted and didn't solve. So I added
>> cv2.imshow('image',img[1])
Adding this did close the image window.Running the command again would create a new instance. Hope you can try if you still face any issues.
The cv2.imshow() function always takes two more functions to load and close the image. These two functions are cv2.waitKey() and cv2.destroyAllWindows(). Inside the cv2.waitKey() function, you can provide any value to close the image and continue with further lines of code.
# First line will provide resizing ability to the window
cv.namedWindow('Amanda', cv.WINDOW_AUTOSIZE)
# Show the image, note that the name of the output window must be same
cv.imshow('Amanda', img)
# T0 load and hold the image
cv.waitKey(0)
# To close the window after the required kill value was provided
cv.destroyAllWindows()
Hoping that you will get the image in a separate window now.
I've installed opencv-contrib-python library instead of opencv-python and now cv2.imshow() function works as expected.
If you have used python notebooks then there is a problem in using cv2.waitKey(0) and cv2.destroyallwindows() in Unix based system to run a program of opencv.
I have an alternative method which would prevent from freezing your image
Steps: -Copy the code from python notebooks and create new filename.py and paste it
- Open terminal
- cd path/to/file
- source activate VirtualEnvironment
- python filename.py
This will run code directly from terminal. Hope this helps you. Example Link: https://youtu.be/8O-FW4Wm10s
I was having this same error until I added the below lines of code. For the waitKey, you can input figures above 0(i.e 1, 100 and above). It serves as the delay time for the window and it is in milliseconds.
----> cv2 waitKey(0)
----> cv2 destroyAllWindows()
I found that i had a breakpoint on the
cv2.waitkey()
funtion. removing that fixed the issue for me
As I tried all solutions mentioned above, it works for displaying an image but in my case, I want to display the video not just the single image in the window, So to solve the problem added
k=cv2.waitkey(10)
if k == 27:
break
after cv2.imshow('title',img)

Offending Command error while Printing EPS

I am printing an EPS File generated with following credentials.
%-12345X#PJL JOB
#PJL ENTER LANGUAGE = POSTSCRIPT
%!PS-Adobe-3.0
%%Title: InvoiceDetail_combine
%%Creator: PScript5.dll Version 5.2.2
%%CreationDate: 10/7/2011 4:46:59
%%For: Administrator
%%BoundingBox: (atend)
%%Pages: (atend)
%%Orientation: Portrait
%%PageOrder: Special
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%DocumentData: Clean7Bit
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
%%LanguageLevel: 2
%%EndComments
While doing Selection Printing on Ricoh Afficio 2090 or any other drivers/printers get the following error printed on the sheets
ERROR: undefined
OFFENDING COMMAND: F4S47
Stack:
.
Kindly Review and suggest a turn around for the same as i am already stuck in this hell. I have tried to convert/extract in PS but all in vain. I am using gsview to Print and view these files.
This is the problem:
%%PageOrder: Special
A ps document with "Special" page order can NOT be re-ordered. You cannot do a selection or range with this file because it is broken for this use. You must reprocess the file using Distiller or ghostscript (ps2ps or ps2pdf) in order to print selected or re-ordered pages from the document.
You can avoid this by generating your postscript files with a real Postscriptâ„¢ driver (one not created by Microsoft).
The GSView Documentation has more about this.
Previously:
This line ...
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
... tells us that the file was generated with HP printers as a target. So this really is not an EPS file. Because it's not Encapsulatable. To generate output on a printer the file has to execute the showpage operator, which is a no-no for EPS files.
So uncheck the EPS box (it's a big fat lie, anyway), and select (install) a Generic Postscript driver. If you need to send it to multiple makes of printer, the file needs to make as few assumptions about the printer as possible.
The first thing is that this is not a valid EPS file, as it has PJL attached at the front. Many PostScript printers will strip this off, but by no means all.
This probably is not the source of the problem.
There is no way to 'review' the problem as you have not supplied the complete PostScript program. Without that there is no way to tell what is actually wrong, the error message tells you that the interpreter encountered 'F4547' while trying to parse a token, and that this has not been defined as a routine.
Most likely the file is corrupt, either damaged in some way, or possibly it is a biinary file and has been transmitted by some process which does has done some kind of conversion (CR/LF is common). The offending command looks like its ASCIIHex encoded, so that may be a red herring.
If you want additional help, you are going to have to make the whole program available somewhere.

Resources