html print

HTMLPrint command line exit codes

Hello,

I am using HTMLPrint for an invoice printing solution which is in development. My company will shortly be purchasing a server license from you..

I would like to know, does htmlprint.exe have exit codes which indicate error conditions? If so, it would be helpful to know what the exit codes are and what error conditions they represent..

I am calling htmprint.exe from a C# application...

var startInfo = new ProcessStartInfo
{
CreateNoWindow = true,
FileName       = "htmlprint.exe",
Arguments      = "{my html doc} -hidewindow"
};

var process = Process.Start(startInfo);

process.WaitForExit();

switch (process.ExitCode)
{
case -1: // html print error?
case 0:  // html print success?
// etc...
}

I would be very grateful if you could clarify this point for me ?
=======================================
Thanks for your message, please refer to return value of htmlprint.exe at below,

0: Printing successful
-10: Can't load necessary DLL files properly
-101: Can't start spooler service
-10: Can't install virtual printer correctly
-11: Something is wrong in command line options
-12: Can't load device settings from target printer
-19: Wrong value in "Copies"
5: Trial version is expired
-21: Can't change printer settings

VeryPDF
=======================================
Thank you, the list was very helpful to me!

I have one further question – is it possible to give the input to htmlprint.exe via stdin instead of an HTML file or URL?

In my application I have HTML stored in memory as a string. Right now I have to create a temporary file on disk to print...

string myHtml = “<html> etc etc... </html>”;
var tempFile = File.WriteAllText(“temp.htm”, myHtml);
Process.Start(“htmlPrint.exe temp.htm”).WaitForExit();
File.Delete(tempFile);

I would prefer to pass the string to stdin like this:

var startInfo = new ProcessStartInfo(“htmlprint.exe”)
startInfo.RedirectStandardInput = true;
var process = Process.Start(startInfo);
process.StandardInput.WriteLine(myHtml);
process.WaitForExit();

And then no html file is necessary - Is it possible to do?
=============================
Thanks for your message, yes, read HTML content from “stdin” is a great solution, but the current version of HTMLPrint command line doesn’t support “stdin” yet, we will try to implement this function in the future, we will let you know after this function is available.

VeryPDF

Thank you XueHeng, the list was very helpful to me!

I have one further question – is it possible to give the input to htmlprint.exe via stdin instead of an HTML file or URL?

In my application I have HTML stored in memory as a string. Right now I have to create a temporary file on disk to print...

string myHtml = “<html> etc etc... </html>”;

var tempFile = File.WriteAllText(“temp.htm”, myHtml);

Process.Start(“htmlPrint.exe temp.htm”).WaitForExit();
File.Delete(tempFile);

I would prefer to pass the string to stdin like this:

var startInfo = new ProcessStartInfo(“htmlprint.exe”)

startInfo.RedirectStandardInput = true;
var process = Process.Start(startInfo);
process.StandardInput.WriteLine(myHtml);

process.WaitForExit();

And then no html file is necessary - Is it possible to do?

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
pdf editor toolkit

Rotate BMP image in PDF Editor Toolkit SDK product

I have enjoyed using your pdf toolkit for c++ for a while, but am stuck on a problem I have. When I put a bmp image from a file into a pdf I can place it where I want, but I don?t see how to rotate it. Please tell me how to rotate an image.
==============================
PDF Editor Toolkit hasn't an option to rotate the BMP image, you need rotate image by yourself, and then insert the image data into PDF page.

VeryPDF
==============================
I program in C++ Borland 5.0. If you can write a program that rotates a bmp file, that would be great.
==============================
Thank you for your quick response. Will this bmp file image rotation function allow me to rotate a bmp file to make another bmp file that is rotated? If so, then I agree. I would like to rotate the image file itself as you first suggested I do so that I can use your other functions on the file as is.

So specifically it would be nice to have a function written in C that takes as its input the input filename, the output filename and the rotation amount in degrees. I know this is standard in windows, but I have been having trouble getting the time to write it.

For example: rotatebmpf(char * inputfn, char *output, short degrees)

Thank you.
==============================
Yes, you are right, this function will rotate BMP to a new BMP first, then you can insert the rotated BMP file into PDF file again, we will implement following function to you,

BOOL RotateBmpFile(char * inputfn, char *output, short degrees)

VeryPDF
==============================
This will save me time. Its your area of expertise. So you are the best person doing this.
==============================
Thanks for your message, we have finished this function to you, please download the new test package from following URL,

XXXXXXXXXXXXXXXXXXXX

After yo download and unzip it to a folder, you can call RotateImageFile() function to rotate the BMP file, this function is support TIFF, JPG, PNG, PCX, TGA, GIF, etc. image files too.

If you encounter any problem with this function, please feel free to let us know, we are glad to assist you asap.

VeryPDF
==============================
Thank you for adding to your product the ability to rotate an image. I was wanting to have the standard windows C code to rotate an image. This function is built into the verywrite.dll but I don’t see the C code for the rotate that I asked for. I want to rotate the image in my C code. The verywrite.dll is used only in the pdf routines. If you can only provide it for bmp files that is ok because that is what I asked for. It is nice to be able to rotate jpgs etc, but I need to rotate a bmp file.
==============================
Please refer to attached C code, you can use this C code to rotate a BMP file without any problem.

VeryPDF
==============================
This is still inside the verypdf dll.

I was requesting a standard windows C program, not a program with any dependencies. For example, BitBlt() puts a bitmap on a dc. StretchDIB() puts a scaled bitmap on a dc. I was going to write the bmp file rotation function with the Xform functions, but I figured you’d be better and quicker than me. It doesn’t have to be the Xform functions, just standard windows api or standard C is fine. Win32 C functions are standard and can be compiled easily into my project. Can you do this?
==============================
Okay, we have write a new source code to you, please refer to this source code file in attachment.

This rotatebmp.cpp file can be compiled and run without any problem in VC++ 6.0.

VeryPDF
==============================
Thank you. It rotates the bmp file nicely. Great work !

I am now trying to put the image on the pdf where I want it.  But it is not moving to the x and y coordinates I want. Here’s my program trying to put it where I want:

void pdfimageout(char gpfn[256],long gpxPos,long gpyPos)
{
char szImageFile[256];
char buf[32];
char buf2[32];

if(access(gpfn,0)==0)
{
GetModulePath(szImageFile,gpfn);

//moves and scales image.
pVerySetFunction(pdfid,Very_Set_ImagePosAndSize,
gpxPos,-gpyPos,
ltoa(gpxPos,buf,10),ltoa(-gpyPos,buf2,10));

pVeryAddImage(pdfid,szImageFile);
}

}

If I do not use the pVerySetFunction(pdfid,Very_Set_ImagePosAndSize function, it comes out perfectly scaled but at the top left of the image.

If I use the pVerySetFunction(pdfid,Very_Set_ImagePosAndSize function,, the image comes onto the page tall and thin and way away from the x,y I want it. Is there a scale I need to use?
==============================
We noticed the width and height parameters are wrong in your code, please use following code to try again,

pVerySetFunction(pdfid,Very_Set_ImagePosAndSize,    gpxPos,-gpyPos,  ltoa(gpxPos+500,buf,10),ltoa(-gpyPos+500,buf2,10));

VeryPDF
==============================
Thank you,

I had my x and y positions backwards.

Thank you.

BTW Do you do any other kinds of programming? I know you are very good with graphics.  Any other areas of programming you like to do?
============================
Thanks for your message, yes, we can provide other graphics and document formats conversion or processing development service, please feel free to email to us your detailed requirement, then we will figure out a solution and quotation to you asap.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
doc to any converter, docprint pro

Print more Excel documents to PDF files from MS Excel VBA application

why does it install 2 printers (docPrint and docPrint PDF Driver) ??? this is very complicated for the user then to select the right one ...

o.k. thx again

now i see TWO printers: docprint and docprint pdf printer driver ... is this right ? i am not sure if i have installed a trial before and didnt deinstall this ...
=========================
Yes, this is right, docPrint Pro v5.0 is contain two printers, docPrint and docPrint PDF Driver.

docPrint is useful for document printing preview function,

docPrint PDF Driver is useful to create PDF, PS, EPS, TIFF, JPG, etc. formats.

If you needn't docPrint, you can run following application to delete it,

"C:\Program Files\docPrint Pro v5.0\unpdf.exe"

VeryPDF
=========================
i've installed now docprint sdk ...
some questions:

- how can i specify "OVERWRITE EXISTING FILE" when print to file(s) ?
- how can i specify to ignore paper size for JPG file - this means not to print on A4 or something like that and to generade the file only with the image within and not to get "white bars around the image" ?
- it put a string for the filename example
"Y:\...\...\etikett_1.jpg" and the driver generates then a file
"y:\...\...\etikett_1_0001.jpg" --> i do not want this ...
- it works per default with JPG fine, how to switch for ex. to EMF ?
=========================
docPrint SDK does overwrite existing PDF file automatically, you needn't specify any additional parameters for overwriting.

Do you wish remove margins from output image files? If yes, you can use trimimage.exe to crop the margins, for example,

"C:\Program Files\docPrint Pro v5.0\psdriver\trimimage.exe" C:\in.tif C:\out.tif

"C:\Program Files\docPrint Pro v5.0\psdriver\trimimage.exe" C:\in.bmp C:\out.png

"C:\Program Files\docPrint Pro v5.0\psdriver\trimimage.exe" C:\in.jpg C:\out.png

Do you want stop add the page header and footer to printout image files? If yes, you need clear the page header and footer options from printing application, such as MS IE or Word or other printing application.

If you wish create the EMF files, you need use docPrint Printer to instead of docPrint PDF Driver, docPrint PDF Driver does support PDF, PS, EPS, JPG, PNG, etc. files creation, but it can't create EMF and WMF files, if you wish create EMF and WMF files, you need use docPrint printer.

You can simple use "-e" parameter to use the docPrint printer, please refer to following command line,

"C:\Program Files\docPrint Pro v5.0\doc2pdf.exe" -e -i C:\input.doc -o C:\output.emf

VeryPDF
=========================
i have found a solution for ONE of my problems;

in windows printer server properties i generated one custom formular with 15x10cm and a indiv. name ...
selecting this paper as the standard one for the doc driver ... printing

pls see the sample out file ... looks better, i can play with adjusting the size to fulfill my req. ...

i hope you will find solutions for the other problems ...
=========================
Thanks for your message, in order to solve the "concurrent printing" problem, you can install several docPrint PDF Driver printers, for example, you can use administrator privilege to run following .bat file to add 20 PDF Drivers into your system, then you can convert up to 20 documents to PDF files at same time,

"C:\Program Files\docPrint Pro v5.0\psdriver\batchaddprinters.bat"

You can install 30, 50, 100 or more PDF Printers into your system for the concurrent printing service.

If this solution is okay to you, please feel free to let us know, we will provide a DLL function to you to find out which printer is "idle" and where to set output filename, if so, you can set output filename for idle printer easily.

VeryPDF
=========================
thank you for your response.
i think it is not a good idea to generate so much printers because it's running on a terminalserver 😉 ... and i think printers can't be hidden ...

why does the driver read the information from registry at the time printing of doc starts and not when the job is scheduled ????

i have this open points now:

- read from registry to late in printing process
- filenames for example "etik_1.jpg" are renamed to "etik_1_0001.jpg" from the driver
- automatic marginless and automatic papersize depending on the resulting size of the image

it wouldt be great if we can find a solution.

one more question which does not depend on your software:
if i start printing job within the loop 300 times, windows does pop up the windows-printing-progress-dialog which is confusing the user ... do you know how to disable this in windows within the makro?

=========================
Because printing speed is slow, the Windows Printing System is can only printing one document at one time, you are unable to print more documents to same printer at same time, this is a design in Windows Spool System.

So, in our docPrint PDF Driver product, if you use just one printer, you can only print one document to docPrint PDF Driver at one time, you need put all documents to a queue, and print these documents to docPrint PDF Driver one by one.

However, we have following solutions to you,

Solution 1:
We have a DOC to Any Converter product, if you can save the selected Excel cells to a temp Excel file first, you can call DOC to Any Converter to convert this Excel document to PDF file, DOC to Any Converter does accept the options from command line, it does not store the output filename to registry, so it does support concurrent conversion properly,

http://www.verydoc.com/doc-to-any.html

you can run following command line to batch convert more documents to PDF files or image files at same time,

start "" "%CD%\doc2any.exe" -killoffice 0 -useprinter "%CD%\example.docx" "%CD%\example.docx.pdf"
start "" "%CD%\doc2any.exe" -killoffice 0 -useprinter "%CD%\example.doc" "%CD%\example.doc.pdf"
start "" "%CD%\doc2any.exe" -multipagetif -bitcount 1 -xres 300 -yres 300 -killoffice 0 -useprinter "%CD%\example.docx" "%CD%\example.docx.tif"
start "" "%CD%\doc2any.exe" -multipagetif -bitcount 1 -xres 300 -yres 300 -killoffice 0 -useprinter "%CD%\example.doc" "%CD%\example.doc.tif"

if you think DOC to Any Converter product is reach your requirement, we can exchange your docPrint SDK with DOC to Any Converter product to you free.

=========================
Solution 2:
Also, we have another solution to you, we can assist you to install a Postscript Printer Driver into your system, you can use "PrintToFile" option to print your selected Excel Cell to a Postscript file first,

Sub Print_PDF()
Application.ActivePrinter = "VeryPDF Postscript Printer"
Worksheets(Array("MRA2", "HMA")).Select
ActiveWindow.SelectedSheets.PrintOut , , , , , printtofile = True, , prtofilename = "c:\test.ps"
End Sub

After you get "c:\test.ps" file, we will provide a Command Line application to you to convert Postscript file to PDF or image file again, this solution does support concurrent printing too.
=========================

Solution 3:
If you are using Office 2007 or 2010, you can install "Microsoft Office 2007 Add-in: Microsoft Save as PDF or XPS" first, then you can save Excel to PDF file by following sample code,

-------------------------------------------------------
Const xlTypePDF = 0

if  Wscript.Arguments.Count > 0 Then

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objExcel = CreateObject("Excel.Application")

For i = 0 to wscript.arguments.count - 1
Set objFile = objFSO.GetFile(WScript.Arguments(i))
Set objDoc = objExcel.Workbooks.Open(WScript.Arguments(i),,TRUE)
dirPath = objFSO.GetParentFolderName(objFile)
fileBaseName = objFSO.GetBaseName(objFile)

pdf = objExcel.ActiveWorkbook.ExportAsFixedFormat (xlTypePDF,dirPath & "\" & fileBaseName & ".pdf")
objExcel.ActiveWorkbook.Close(False)
Next

objExcel.Quit
Else
msgbox("Sie muessen eine Datei zum konvertieren ausw?hlen.")
End If
-------------------------------------------------------

You can use "ExportAsFixedFormat" function to convert Excel document to PDF file directly, this solution does support concurrent conversion function too.

If you wish convert PDF file to image files, we can provide a PDF to Image Converter Command Line to you free, you can call PDF to Image Converter Command Line from your code to convert PDF file to image file again.
======================================

Above three solutions are all can solve "concurrent printing" function to you, what is your attitude for above three solutions?

From my point, solution #3 is great, you can try the solution #3, save the Excel document to PDF file first, and convert PDF file to image files at later.

Because JPG format doesn't support multi-page format, so we have to append "XXXX" number to the filename. If you wish disable this feature, please feel free to let us know, we will add an option to you to disable this feature.

You can simple call following command line from your code to remove the margins from image files, we hoping this command line application will useful to you,

"C:\Program Files\docPrint Pro v5.0\psdriver\trimimage.exe" C:\in.png C:\out.png

MS Office application hasn't an option to hide the printing dialog, in the past, we have developed a "HideDialogs.exe" application, this HideDialogs.exe does lookup all windows and hide the printing dialog automatically, if possible, you write this application too, for example,

HWND hWnd = FindWindow("Title of excel printing dialog");
ShowWindow(hWnd, SW_HIDE);

We hoping above solution will helpful to you, you may give it a try.

VeryPDF
=========================
today evening i will try to save in the loop with sheet.saveas directly to a xls file ...
if this works fast and well then we can try it with your solution to convert all the 300 file AFTER the loop with a cmd/batch to generate the jpg files ...
will the jpg files then have the same quality as if gong throug the printer driver ??? because that is what i ned ...
or then maybe directly to EMF files ?

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

Yes, PDF to Image Converter does create the JPG files have same quality as if gong through the printer driver.

Also, PDF to Image Converter is able to convert PDF files to raster EMF files, all contents will be converted into an entire image in the EMF file.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
docprint pro

VeryPDF Status / Quick Question #2 – Class not Registered DocPrint

I tried registering docPrintCom.dll on the client workstation and it successfully registers docPrintCom.  But, I still get a class not registered when I try and do:

docPrint = CreateObject("DocPrintCom.docPrint")

Is there something else I need to do?
============================
Are you using 64bit system? If yes, please compile your EXE application with
x86 platform option, then your EXE will able to access to
("DocPrintCom.docPrint") properly.

VeryPDF
============================
Actually this error happens on a 32bit system and I'm compiling on a 32 bit system.
============================
Please by following steps to try again,

1. Please run "C:\Program Files\docPrint Pro v5.0\docPrint_Service.exe" application first, you will see an icon appear in the right-bottom tray area,

2. Please please double click "C:\Program Files\docPrint Pro v5.0\docprint-com.vbs" file to convert a web page to PDF file,

Can you work fine with "C:\Program Files\docPrint Pro v5.0\docprint-com.vbs" script?

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
pdf to image converter

pdf to image com/sdk/dll on Windows 2008 R2 – 64 Bit, run from Network Service account

Hi Support,

I seem to be having a problem registering you component on a win 2008 64 bit machine.  Please see the screenshot below:

You can see which files I have included in the folder, maybe I’ve got the wrong ones.  I’d appreciate you help.
========================
Please launch a new CMD window with administrator privilege, run this command line in new CMD window again, then you can register it properly.

VeryPDF
========================
Thanks, I’ve done that but now I am getting the following error:

System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {51BC538F-73BA-4716-8576-B5FECD42C894} failed due to the following error: 80070005.

Do you have any ideas?
========================
Are you compile the source code with AnyCPU mode? If yes, please re-compile the source code with x86 platform to try again.

If you still have same problem, ca you please create a remote desktop account on your test machine? after we logged into your test machine, we will research this problem for you asap.

VeryPDF
========================
Hi,  Its working fine on my set machine which is a windows 7 PC but when I install in on my windows 2008 r2 64 bit server I get the following error when my application invokes your component:

System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {51BC538F-73BA-4716-8576-B5FECD42C894} failed due to the following error: 80070005.

Do I need to compile the code as x86 or x64?

I dont suppose you have a telephone number I can call you on?

Thanks for your help.
========================
By changing my application pool user from Network Service to my administrator account I have managed to get it working so it looks like its a permission problem rather than a 32/64 bit compilation issue. Do you have any ideas on how I may resolve this as I really don’t want my site to run as an admin account as this is extremely dangerous?  I must need to grant the network service some additional permission.

Thanks
========================
Hi Support,  I have managed to resolve the issue by making the following steps:

1. Click Start -> Run
2. Enter DCOMCNFG and press OK. This will open the DCOMCNFG window.
3. Browse down the tree to Console Root -> Component Services -> Computers -> My Computer
4. Right click on "My Computer" and select properties
5. Select the "Default Properties" tab
a. Enable Distributed COM on this computer - Option is checked
b. Default Authentication Level - Set to Connect
c. Default Impersonation Level - Set to Identify
6. Select the "COM Security" tab
7. Click on Access Permissions ' Edit Default
a. Add "Anonymous", "Everyone", "Interactive", "Network", "System" with Local and Remote access permissions set.
8. Click on Launch and Activation Permissions ' Edit Default
a. Add "Anonymous", "Everyone", "Interactive", "Network", "System" with Local and Remote access permissions set.
9. Click on OK
10. Close the DCOMCNFG window

I hope this helps

Kind regards
========================
Thanks for your great information, your information will helpful for our other customers in the future.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)