_HTML2PDFConverterServiceImplBase.java 1.91 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.html2pdf;

import com.adobe.html2pdf.*;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.CompletionStatus;
import org.omg.CORBA.portable.*;

import java.util.Hashtable;

public abstract class _HTML2PDFConverterServiceImplBase
extends ObjectImpl
implements HTML2PDFConverterService,
InvokeHandler {
    private static Hashtable _methods = new Hashtable();
    private static String[] __ids;

    public OutputStream _invoke(String $method, InputStream in, ResponseHandler $rh) {
        OutputStream out = null;
        Integer __method = (Integer)_methods.get($method);
        if (__method == null) {
            throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
        }
        switch (__method) {
            case 0: {
                try {
                    String url = in.read_wstring();
                    String pdfFilePath = in.read_wstring();
                    Html2PdfSettings htmlConversionSettings = Html2PdfSettingsHelper.read(in);
                    Html2PdfFontPaths fontPaths = Html2PdfFontPathsHelper.read(in);
                    long timeout = in.read_longlong();
                    this.ConvertToPDF(url, pdfFilePath, htmlConversionSettings, fontPaths, timeout);
                    out = $rh.createReply();
                }
                catch (HtmlToPdfFailureException $ex) {
                    out = $rh.createExceptionReply();
                    HtmlToPdfFailureExceptionHelper.write(out, $ex);
                }
                break;
            }
            default: {
                throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
            }
        }
        return out;
    }

    public String[] _ids() {
        return (String[])__ids.clone();
    }

    static {
        _methods.put("ConvertToPDF", new Integer(0));
        __ids = new String[]{"IDL:com/adobe/html2pdf/HTML2PDFConverterService:1.0"};
    }
}