This convolution arithmetic doc 29 gives you some general information about convolutions as well as transposed convolutions and also about the relationship of their parameters, which might be useful for your use case.
Depending on your input shape, you might need to change more parameters than the padding, such as the kernel size.